diff options
Diffstat (limited to 'packages/contracts/test/ether_token.ts')
-rw-r--r-- | packages/contracts/test/ether_token.ts | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/packages/contracts/test/ether_token.ts b/packages/contracts/test/ether_token.ts index a71d96cb8..4c85147df 100644 --- a/packages/contracts/test/ether_token.ts +++ b/packages/contracts/test/ether_token.ts @@ -21,6 +21,13 @@ describe('EtherToken', () => { const gasPrice = Web3Wrapper.toBaseUnitAmount(new BigNumber(20), 9); let zeroEx: ZeroEx; let etherTokenAddress: string; + + before(async () => { + await blockchainLifecycle.startAsync(); + }); + after(async () => { + await blockchainLifecycle.revertAsync(); + }); before(async () => { const accounts = await web3Wrapper.getAvailableAddressesAsync(); account = accounts[0]; @@ -55,7 +62,7 @@ describe('EtherToken', () => { const ethToDeposit = new BigNumber(Web3Wrapper.toWei(new BigNumber(1))); const txHash = await zeroEx.etherToken.depositAsync(etherTokenAddress, ethToDeposit, account); - const receipt = await zeroEx.awaitTransactionMinedAsync(txHash); + const receipt = await zeroEx.awaitTransactionMinedAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS); const ethSpentOnGas = gasPrice.times(receipt.gasUsed); const finalEthBalance = await web3Wrapper.getBalanceInWeiAsync(account); @@ -86,7 +93,7 @@ describe('EtherToken', () => { const txHash = await zeroEx.etherToken.withdrawAsync(etherTokenAddress, ethTokensToWithdraw, account, { gasLimit: constants.MAX_ETHERTOKEN_WITHDRAW_GAS, }); - const receipt = await zeroEx.awaitTransactionMinedAsync(txHash); + const receipt = await zeroEx.awaitTransactionMinedAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS); const ethSpentOnGas = gasPrice.times(receipt.gasUsed); const finalEthBalance = await web3Wrapper.getBalanceInWeiAsync(account); @@ -113,7 +120,7 @@ describe('EtherToken', () => { gasPrice, }); - const receipt = await zeroEx.awaitTransactionMinedAsync(txHash); + const receipt = await zeroEx.awaitTransactionMinedAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS); const ethSpentOnGas = gasPrice.times(receipt.gasUsed); const finalEthBalance = await web3Wrapper.getBalanceInWeiAsync(account); |