aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/test/utils
diff options
context:
space:
mode:
authorGreg Hysen <greg.hysen@gmail.com>2018-08-25 08:17:52 +0800
committerGreg Hysen <greg.hysen@gmail.com>2018-08-25 09:20:26 +0800
commit1c7ba6a31533b3202be7a464452b14aa58a0337b (patch)
tree5eecb270bbdb48f286ab34f15fd9baa68ff91850 /packages/contracts/test/utils
parent0a6f107243eb7df309766cc83942e667ce28e858 (diff)
downloaddexon-sol-tools-1c7ba6a31533b3202be7a464452b14aa58a0337b.tar
dexon-sol-tools-1c7ba6a31533b3202be7a464452b14aa58a0337b.tar.gz
dexon-sol-tools-1c7ba6a31533b3202be7a464452b14aa58a0337b.tar.bz2
dexon-sol-tools-1c7ba6a31533b3202be7a464452b14aa58a0337b.tar.lz
dexon-sol-tools-1c7ba6a31533b3202be7a464452b14aa58a0337b.tar.xz
dexon-sol-tools-1c7ba6a31533b3202be7a464452b14aa58a0337b.tar.zst
dexon-sol-tools-1c7ba6a31533b3202be7a464452b14aa58a0337b.zip
Extract only `fill` event logs
Diffstat (limited to 'packages/contracts/test/utils')
-rw-r--r--packages/contracts/test/utils/match_order_tester.ts9
1 files changed, 5 insertions, 4 deletions
diff --git a/packages/contracts/test/utils/match_order_tester.ts b/packages/contracts/test/utils/match_order_tester.ts
index 4d27fc630..e0c55b834 100644
--- a/packages/contracts/test/utils/match_order_tester.ts
+++ b/packages/contracts/test/utils/match_order_tester.ts
@@ -42,10 +42,11 @@ export class MatchOrderTester {
takerAddress: string,
expectedTransferAmounts: TransferAmounts,
): Promise<void> {
- // Should have two logs -- one for each order.
- expect(transactionReceipt.logs.length, 'Checking number of logs').to.be.equal(2);
+ // Should have two fill event logs -- one for each order.
+ const transactionFillLogs = _.filter(transactionReceipt.logs, ['event', 'Fill']);
+ expect(transactionFillLogs.length, 'Checking number of logs').to.be.equal(2);
// First log is for left fill
- const leftLog = (transactionReceipt.logs[0] as any).args as LoggedTransferAmounts;
+ const leftLog = (transactionFillLogs[0] as any).args as LoggedTransferAmounts;
expect(leftLog.makerAddress, 'Checking logged maker address of left order').to.be.equal(
signedOrderLeft.makerAddress,
);
@@ -55,7 +56,7 @@ export class MatchOrderTester {
const feePaidByLeftMaker = new BigNumber(leftLog.makerFeePaid);
const feePaidByTakerLeft = new BigNumber(leftLog.takerFeePaid);
// Second log is for right fill
- const rightLog = (transactionReceipt.logs[1] as any).args as LoggedTransferAmounts;
+ const rightLog = (transactionFillLogs[1] as any).args as LoggedTransferAmounts;
expect(rightLog.makerAddress, 'Checking logged maker address of right order').to.be.equal(
signedOrderRight.makerAddress,
);