diff options
author | Alex Browne <stephenalexbrowne@gmail.com> | 2018-05-24 09:12:41 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-24 09:12:41 +0800 |
commit | 2f7ab3e32d1c54f42c435503426bc421fa89afd8 (patch) | |
tree | dfa0fb838fb4b1bdb36a45eaa820351bfaf1f04f /packages/contracts/test/multi_sig_with_time_lock.ts | |
parent | 2f1a4042bf924cf5d07d724d5d1a1c0a2c181f4f (diff) | |
parent | f6f2818a02d0ef1880f6e4391840659cc8dc2395 (diff) | |
download | dexon-sol-tools-2f7ab3e32d1c54f42c435503426bc421fa89afd8.tar dexon-sol-tools-2f7ab3e32d1c54f42c435503426bc421fa89afd8.tar.gz dexon-sol-tools-2f7ab3e32d1c54f42c435503426bc421fa89afd8.tar.bz2 dexon-sol-tools-2f7ab3e32d1c54f42c435503426bc421fa89afd8.tar.lz dexon-sol-tools-2f7ab3e32d1c54f42c435503426bc421fa89afd8.tar.xz dexon-sol-tools-2f7ab3e32d1c54f42c435503426bc421fa89afd8.tar.zst dexon-sol-tools-2f7ab3e32d1c54f42c435503426bc421fa89afd8.zip |
Merge pull request #613 from 0xProject/check-tx-receipt-status
Check transaction receipt status
Diffstat (limited to 'packages/contracts/test/multi_sig_with_time_lock.ts')
-rw-r--r-- | packages/contracts/test/multi_sig_with_time_lock.ts | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/packages/contracts/test/multi_sig_with_time_lock.ts b/packages/contracts/test/multi_sig_with_time_lock.ts index 6f18de3e7..732077df2 100644 --- a/packages/contracts/test/multi_sig_with_time_lock.ts +++ b/packages/contracts/test/multi_sig_with_time_lock.ts @@ -79,7 +79,7 @@ describe('MultiSigWalletWithTimeLock', () => { args: [SECONDS_TIME_LOCKED.toNumber()], }; const txHash = await multiSigWrapper.submitTransactionAsync(destination, from, dataParams); - const txReceipt = await web3Wrapper.awaitTransactionMinedAsync( + const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync( txHash, constants.AWAIT_TRANSACTION_MINED_MS, ); @@ -102,7 +102,7 @@ describe('MultiSigWalletWithTimeLock', () => { args: [SECONDS_TIME_LOCKED.toNumber()], }; let txHash = await multiSigWrapper.submitTransactionAsync(destination, from, dataParams); - const txReceipt = await web3Wrapper.awaitTransactionMinedAsync( + const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync( txHash, constants.AWAIT_TRANSACTION_MINED_MS, ); @@ -112,7 +112,10 @@ describe('MultiSigWalletWithTimeLock', () => { txId = log.args.transactionId; txHash = await multiSig.confirmTransaction.sendTransactionAsync(txId, { from: owners[1] }); - const res = await web3Wrapper.awaitTransactionMinedAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS); + const res = await web3Wrapper.awaitTransactionSuccessAsync( + txHash, + constants.AWAIT_TRANSACTION_MINED_MS, + ); expect(res.logs).to.have.length(2); const blockNum = await web3Wrapper.getBlockNumberAsync(); @@ -132,7 +135,7 @@ describe('MultiSigWalletWithTimeLock', () => { args: [SECONDS_TIME_LOCKED.toNumber()], }; let txHash = await multiSigWrapper.submitTransactionAsync(destination, from, dataParams); - const txReceipt = await web3Wrapper.awaitTransactionMinedAsync( + const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync( txHash, constants.AWAIT_TRANSACTION_MINED_MS, ); @@ -142,12 +145,15 @@ describe('MultiSigWalletWithTimeLock', () => { txId = log.args.transactionId; txHash = await multiSig.confirmTransaction.sendTransactionAsync(txId, { from: owners[1] }); - await web3Wrapper.awaitTransactionMinedAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS); + await web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS); expect(initialSecondsTimeLocked).to.be.equal(0); txHash = await multiSig.executeTransaction.sendTransactionAsync(txId, { from: owners[0] }); - const res = await web3Wrapper.awaitTransactionMinedAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS); + const res = await web3Wrapper.awaitTransactionSuccessAsync( + txHash, + constants.AWAIT_TRANSACTION_MINED_MS, + ); expect(res.logs).to.have.length(2); const secondsTimeLocked = new BigNumber(await multiSig.secondsTimeLocked.callAsync()); @@ -182,7 +188,7 @@ describe('MultiSigWalletWithTimeLock', () => { args: [newSecondsTimeLocked], }; let txHash = await multiSigWrapper.submitTransactionAsync(destination, from, dataParams); - let txReceipt = await web3Wrapper.awaitTransactionMinedAsync( + let txReceipt = await web3Wrapper.awaitTransactionSuccessAsync( txHash, constants.AWAIT_TRANSACTION_MINED_MS, ); @@ -193,7 +199,10 @@ describe('MultiSigWalletWithTimeLock', () => { txHash = await multiSig.confirmTransaction.sendTransactionAsync(txId, { from: owners[1], }); - txReceipt = await web3Wrapper.awaitTransactionMinedAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS); + txReceipt = await web3Wrapper.awaitTransactionSuccessAsync( + txHash, + constants.AWAIT_TRANSACTION_MINED_MS, + ); expect(txReceipt.logs).to.have.length(2); }); const newSecondsTimeLocked = 0; @@ -205,7 +214,7 @@ describe('MultiSigWalletWithTimeLock', () => { it('should execute if it has enough confirmations and is past the time lock', async () => { await web3Wrapper.increaseTimeAsync(SECONDS_TIME_LOCKED.toNumber()); - await web3Wrapper.awaitTransactionMinedAsync( + await web3Wrapper.awaitTransactionSuccessAsync( await multiSig.executeTransaction.sendTransactionAsync(txId, { from: owners[0] }), constants.AWAIT_TRANSACTION_MINED_MS, ); |