diff options
author | Alex Browne <stephenalexbrowne@gmail.com> | 2018-05-24 09:13:18 +0800 |
---|---|---|
committer | Alex Browne <stephenalexbrowne@gmail.com> | 2018-06-07 03:39:43 +0800 |
commit | 00bf957b53c22f3ccdd6c2e7ad75f0c9e15caa38 (patch) | |
tree | 2fc183c1e35a7868bbc75fb5e10ce919e443398a /packages/contracts/test/multi_sig_with_time_lock.ts | |
parent | 5b999c2f7d25b5b7982dd5f857bc79881fafc52e (diff) | |
download | dexon-sol-tools-00bf957b53c22f3ccdd6c2e7ad75f0c9e15caa38.tar dexon-sol-tools-00bf957b53c22f3ccdd6c2e7ad75f0c9e15caa38.tar.gz dexon-sol-tools-00bf957b53c22f3ccdd6c2e7ad75f0c9e15caa38.tar.bz2 dexon-sol-tools-00bf957b53c22f3ccdd6c2e7ad75f0c9e15caa38.tar.lz dexon-sol-tools-00bf957b53c22f3ccdd6c2e7ad75f0c9e15caa38.tar.xz dexon-sol-tools-00bf957b53c22f3ccdd6c2e7ad75f0c9e15caa38.tar.zst dexon-sol-tools-00bf957b53c22f3ccdd6c2e7ad75f0c9e15caa38.zip |
Add more transactions to Geth on init. Skip tests that are failing.
Diffstat (limited to 'packages/contracts/test/multi_sig_with_time_lock.ts')
-rw-r--r-- | packages/contracts/test/multi_sig_with_time_lock.ts | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/packages/contracts/test/multi_sig_with_time_lock.ts b/packages/contracts/test/multi_sig_with_time_lock.ts index acd6fc8d2..090ce91f5 100644 --- a/packages/contracts/test/multi_sig_with_time_lock.ts +++ b/packages/contracts/test/multi_sig_with_time_lock.ts @@ -148,14 +148,23 @@ describe('MultiSigWalletWithTimeLock', () => { txId = log.args.transactionId; await multiSigWrapper.confirmTransactionAsync(txId, owners[1]); }); + it('should throw if it has enough confirmations but is not past the time lock', async () => { return expectRevertOrAlwaysFailingTransaction( multiSig.executeTransaction.sendTransactionAsync(txId, { from: owners[0] }), ); }); + // TODO(albrow): increaseTimeAsync not supported it('should execute if it has enough confirmations and is past the time lock', async () => { await web3Wrapper.increaseTimeAsync(SECONDS_TIME_LOCKED.toNumber()); + // Note: we need to send a transaction after increasing time so + // that a block is actually mined. The contract looks at the + // last mined block for the timestamp. + await web3Wrapper.awaitTransactionSuccessAsync( + await web3Wrapper.sendTransactionAsync({ from: owners[0], to: owners[1], value: 1 }), + constants.AWAIT_TRANSACTION_MINED_MS, + ); await web3Wrapper.awaitTransactionSuccessAsync( await multiSig.executeTransaction.sendTransactionAsync(txId, { from: owners[0] }), constants.AWAIT_TRANSACTION_MINED_MS, |