diff options
author | Amir Bandeali <abandeali1@gmail.com> | 2018-08-13 08:56:09 +0800 |
---|---|---|
committer | Amir Bandeali <abandeali1@gmail.com> | 2018-08-17 08:31:21 +0800 |
commit | a4d6bc3190049996e68076eaf56762c05a71c88e (patch) | |
tree | 388355f80ce846cb4351b5c26e7b2d1f1c938e78 /packages/contracts | |
parent | 0b9a9d92afc48745b2e4b438f31640c362882f78 (diff) | |
download | dexon-0x-contracts-a4d6bc3190049996e68076eaf56762c05a71c88e.tar dexon-0x-contracts-a4d6bc3190049996e68076eaf56762c05a71c88e.tar.gz dexon-0x-contracts-a4d6bc3190049996e68076eaf56762c05a71c88e.tar.bz2 dexon-0x-contracts-a4d6bc3190049996e68076eaf56762c05a71c88e.tar.lz dexon-0x-contracts-a4d6bc3190049996e68076eaf56762c05a71c88e.tar.xz dexon-0x-contracts-a4d6bc3190049996e68076eaf56762c05a71c88e.tar.zst dexon-0x-contracts-a4d6bc3190049996e68076eaf56762c05a71c88e.zip |
Fix tests that assumed logs were being filtered
Diffstat (limited to 'packages/contracts')
4 files changed, 11 insertions, 4 deletions
diff --git a/packages/contracts/test/asset_proxy/proxies.ts b/packages/contracts/test/asset_proxy/proxies.ts index 62215f08d..a35426190 100644 --- a/packages/contracts/test/asset_proxy/proxies.ts +++ b/packages/contracts/test/asset_proxy/proxies.ts @@ -271,7 +271,7 @@ describe('Asset Transfer Proxies', () => { }), ); // Verify that no log was emitted by erc721 receiver - expect(tx.logs.length).to.be.equal(0); + expect(tx.logs.length).to.be.equal(1); // Verify transfer was successful const newOwnerMakerAsset = await erc721Token.ownerOf.callAsync(erc721MakerTokenId); expect(newOwnerMakerAsset).to.be.bignumber.equal(erc721Receiver.address); diff --git a/packages/contracts/test/multisig/asset_proxy_owner.ts b/packages/contracts/test/multisig/asset_proxy_owner.ts index 6b98605d3..9515941ff 100644 --- a/packages/contracts/test/multisig/asset_proxy_owner.ts +++ b/packages/contracts/test/multisig/asset_proxy_owner.ts @@ -422,7 +422,7 @@ describe('AssetProxyOwner', () => { await multiSigWrapper.confirmTransactionAsync(txId, owners[1]); const execRes = await multiSigWrapper.executeRemoveAuthorizedAddressAtIndexAsync(txId, owners[0]); - const execLog = execRes.logs[0] as LogWithDecodedArgs<AssetProxyOwnerExecutionEventArgs>; + const execLog = execRes.logs[1] as LogWithDecodedArgs<AssetProxyOwnerExecutionEventArgs>; expect(execLog.args.transactionId).to.be.bignumber.equal(txId); const tx = await testAssetProxyOwner.transactions.callAsync(txId); @@ -449,7 +449,7 @@ describe('AssetProxyOwner', () => { await multiSigWrapper.confirmTransactionAsync(txId, owners[1]); const execRes = await multiSigWrapper.executeRemoveAuthorizedAddressAtIndexAsync(txId, owners[0]); - const execLog = execRes.logs[0] as LogWithDecodedArgs<AssetProxyOwnerExecutionEventArgs>; + const execLog = execRes.logs[1] as LogWithDecodedArgs<AssetProxyOwnerExecutionEventArgs>; expect(execLog.args.transactionId).to.be.bignumber.equal(txId); const tx = await testAssetProxyOwner.transactions.callAsync(txId); diff --git a/packages/contracts/test/utils/exchange_wrapper.ts b/packages/contracts/test/utils/exchange_wrapper.ts index d57592d6d..f2b9e76d7 100644 --- a/packages/contracts/test/utils/exchange_wrapper.ts +++ b/packages/contracts/test/utils/exchange_wrapper.ts @@ -266,4 +266,7 @@ export class ExchangeWrapper { ); return data; } + public getExchangeAddress(): string { + return this._exchange.address; + } } diff --git a/packages/contracts/test/utils/fill_order_combinatorial_utils.ts b/packages/contracts/test/utils/fill_order_combinatorial_utils.ts index f18ad0dd3..a9318571c 100644 --- a/packages/contracts/test/utils/fill_order_combinatorial_utils.ts +++ b/packages/contracts/test/utils/fill_order_combinatorial_utils.ts @@ -504,7 +504,11 @@ export class FillOrderCombinatorialUtils { const actFilledTakerAmount = await this.exchangeWrapper.getTakerAssetFilledAmountAsync(orderHash); expect(actFilledTakerAmount).to.be.bignumber.equal(expFilledTakerAmount, 'filledTakerAmount'); - expect(txReceipt.logs.length).to.be.equal(1, 'logs length'); + const exchangeLogs = _.filter( + txReceipt.logs, + txLog => txLog.address === this.exchangeWrapper.getExchangeAddress(), + ); + expect(exchangeLogs.length).to.be.equal(1, 'logs length'); // tslint:disable-next-line:no-unnecessary-type-assertion const log = txReceipt.logs[0] as LogWithDecodedArgs<ExchangeFillEventArgs>; expect(log.args.makerAddress).to.be.equal(makerAddress, 'log.args.makerAddress'); |