From 0b6ea1d0468847ac07c40232cf1431e2bb92ac86 Mon Sep 17 00:00:00 2001 From: Jacob Evans Date: Wed, 11 Jul 2018 20:45:18 +1000 Subject: Contract Wrappers - Ether token block range Start after migrations to avoid any unexpected logs --- .../contract-wrappers/test/ether_token_wrapper_test.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/contract-wrappers/test/ether_token_wrapper_test.ts b/packages/contract-wrappers/test/ether_token_wrapper_test.ts index 0a860884a..48bd6d3f6 100644 --- a/packages/contract-wrappers/test/ether_token_wrapper_test.ts +++ b/packages/contract-wrappers/test/ether_token_wrapper_test.ts @@ -336,15 +336,19 @@ describe('EtherTokenWrapper', () => { describe('#getLogsAsync', () => { let etherTokenAddress: string; let erc20ProxyAddress: string; - const blockRange: BlockRange = { - fromBlock: 0, - toBlock: BlockParamLiteral.Latest, - }; + let blockRange: BlockRange; let txHash: string; - before(() => { + before(async () => { addressWithETH = userAddresses[0]; etherTokenAddress = tokenUtils.getWethTokenAddress(); erc20ProxyAddress = contractWrappers.erc20Proxy.getContractAddress(); + // Start the block range after all migrations to avoid unexpected logs + const currentBlock = await web3Wrapper.getBlockNumberAsync(); + const fromBlock = currentBlock + 1; + blockRange = { + fromBlock, + toBlock: BlockParamLiteral.Latest, + }; }); it('should get logs with decoded args emitted by Approval', async () => { txHash = await contractWrappers.erc20Token.setUnlimitedProxyAllowanceAsync( -- cgit