diff options
author | Fabio Berger <me@fabioberger.com> | 2017-11-24 08:21:48 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2017-11-24 08:21:48 +0800 |
commit | ecfee00feca331ee1efa55165471d79774cb03d2 (patch) | |
tree | 232bb42d6b61ce9beacc484ab286b33a9b894da9 /packages/website/ts/blockchain.ts | |
parent | d1342c6326ccae0b6f42b690c91ba570ea87caef (diff) | |
download | dexon-0x-contracts-ecfee00feca331ee1efa55165471d79774cb03d2.tar.gz dexon-0x-contracts-ecfee00feca331ee1efa55165471d79774cb03d2.tar.zst dexon-0x-contracts-ecfee00feca331ee1efa55165471d79774cb03d2.zip |
Fix subscriptions given latest changes to 0x.js
Diffstat (limited to 'packages/website/ts/blockchain.ts')
-rw-r--r-- | packages/website/ts/blockchain.ts | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/packages/website/ts/blockchain.ts b/packages/website/ts/blockchain.ts index 9be764917..b13c48a65 100644 --- a/packages/website/ts/blockchain.ts +++ b/packages/website/ts/blockchain.ts @@ -488,6 +488,7 @@ export class Blockchain { const subscriptionId = await this.zeroEx.exchange.subscribeAsync( ExchangeEvents.LogFill, indexFilterValues, async (err: Error, decodedLogEvent: DecodedLogEvent<LogFillContractEventArgs>) => { + const decodedLog = decodedLogEvent.log; if (err) { // Note: it's not entirely clear from the documentation which // errors will be thrown by `watch`. For now, let's log the error @@ -496,12 +497,12 @@ export class Blockchain { this.stopWatchingExchangeLogFillEventsAsync(); // fire and forget return; } else { - if (!this.doesLogEventInvolveUser(decodedLogEvent)) { + if (!this.doesLogEventInvolveUser(decodedLog)) { return; // We aren't interested in the fill event } - this.updateLatestFillsBlockIfNeeded(decodedLogEvent.blockNumber); - const fill = await this.convertDecodedLogToFillAsync(decodedLogEvent); - if (decodedLogEvent.removed) { + this.updateLatestFillsBlockIfNeeded(decodedLog.blockNumber); + const fill = await this.convertDecodedLogToFillAsync(decodedLog); + if (decodedLogEvent.isRemoved) { tradeHistoryStorage.removeFillFromUser(this.userAddress, this.networkId, fill); } else { tradeHistoryStorage.addFillToUser(this.userAddress, this.networkId, fill); |