In @0x/abi-gen-templates: Add timeoutMs parameter to awaitTransactionSuccessAsync

This commit is contained in:
Lawrence Forman
2019-04-26 15:04:29 -04:00
parent be0b296769
commit 4710b40e45

View File

@@ -28,11 +28,16 @@ public {{this.tsName}} = {
async awaitTransactionSuccessAsync(
{{> typed_params inputs=inputs}}
pollingIntervalMs?: number,
timeoutMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as {{contractName}}Contract;
const txHash = await self.{{this.tsName}}.sendTransactionAsync({{> params input=inputs}});
// tslint:disable-next-line: no-unnecessary-type-assertion
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(
txHash,
pollingIntervalMs,
timeoutMs,
) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},