diff options
author | Jacob Evans <jacob@dekz.net> | 2017-11-16 08:30:18 +0800 |
---|---|---|
committer | Jacob Evans <jacob@dekz.net> | 2017-11-16 08:30:18 +0800 |
commit | e9a5ae21e0e738082924da24b62bb44a4df84286 (patch) | |
tree | 8f4774a90f8b8c73b8988c12cd7645c612c2ee21 | |
parent | 0bcf7e56c2806d42ed43bf5377386501f582951a (diff) | |
download | dexon-sol-tools-e9a5ae21e0e738082924da24b62bb44a4df84286.tar dexon-sol-tools-e9a5ae21e0e738082924da24b62bb44a4df84286.tar.gz dexon-sol-tools-e9a5ae21e0e738082924da24b62bb44a4df84286.tar.bz2 dexon-sol-tools-e9a5ae21e0e738082924da24b62bb44a4df84286.tar.lz dexon-sol-tools-e9a5ae21e0e738082924da24b62bb44a4df84286.tar.xz dexon-sol-tools-e9a5ae21e0e738082924da24b62bb44a4df84286.tar.zst dexon-sol-tools-e9a5ae21e0e738082924da24b62bb44a4df84286.zip |
Fix nits
-rw-r--r-- | packages/0x.js/src/order_watcher/order_state_watcher.ts | 2 | ||||
-rw-r--r-- | packages/0x.js/test/order_state_watcher_test.ts | 4 |
2 files changed, 2 insertions, 4 deletions
diff --git a/packages/0x.js/src/order_watcher/order_state_watcher.ts b/packages/0x.js/src/order_watcher/order_state_watcher.ts index 71dfeaedc..0051aaf5b 100644 --- a/packages/0x.js/src/order_watcher/order_state_watcher.ts +++ b/packages/0x.js/src/order_watcher/order_state_watcher.ts @@ -220,12 +220,12 @@ export class OrderStateWatcher { if (_.isUndefined(this._dependentOrderHashes[signedOrder.maker][signedOrder.makerTokenAddress])) { this._dependentOrderHashes[signedOrder.maker][signedOrder.makerTokenAddress] = new Set(); } + this._dependentOrderHashes[signedOrder.maker][signedOrder.makerTokenAddress].add(orderHash); const exchange = (this._orderFilledCancelledLazyStore as any).exchange as ExchangeWrapper; const zrxTokenAddress = await exchange.getZRXTokenAddressAsync(); if (_.isUndefined(this._dependentOrderHashes[signedOrder.maker][zrxTokenAddress])) { this._dependentOrderHashes[signedOrder.maker][zrxTokenAddress] = new Set(); } - this._dependentOrderHashes[signedOrder.maker][signedOrder.makerTokenAddress].add(orderHash); this._dependentOrderHashes[signedOrder.maker][zrxTokenAddress].add(orderHash); } private removeFromDependentOrderHashes(makerAddress: string, tokenAddress: string, orderHash: string) { diff --git a/packages/0x.js/test/order_state_watcher_test.ts b/packages/0x.js/test/order_state_watcher_test.ts index 0d8a509e2..00b290252 100644 --- a/packages/0x.js/test/order_state_watcher_test.ts +++ b/packages/0x.js/test/order_state_watcher_test.ts @@ -235,7 +235,7 @@ describe('OrderStateWatcher', () => { ); })().catch(done); }); - it('should callback when Fee Token transferrable changes', (done: DoneCallback) => { + it('should trigger the callback when orders backing ZRX allowance changes', (done: DoneCallback) => { (async () => { const makerFee = ZeroEx.toBaseUnitAmount(new BigNumber(2), 18); const takerFee = ZeroEx.toBaseUnitAmount(new BigNumber(0), 18); @@ -245,8 +245,6 @@ describe('OrderStateWatcher', () => { const orderHash = ZeroEx.getOrderHashHex(signedOrder); await zeroEx.orderStateWatcher.addOrderAsync(signedOrder); const callback = reportCallbackErrors(done)((orderState: OrderState) => { - const invalidOrderState = orderState as OrderStateInvalid; - expect(invalidOrderState.orderHash).to.be.equal(orderHash); done(); }); zeroEx.orderStateWatcher.subscribe(callback); |