diff options
author | Ara Kevonian <=> | 2018-03-31 00:59:57 +0800 |
---|---|---|
committer | Ara Kevonian <=> | 2018-03-31 00:59:57 +0800 |
commit | 3e285c0ef109c380f5fcc872555d4cdaeee79384 (patch) | |
tree | 3ff266d26d3f3e3c1cd855607536b87e5b5a9cd2 /packages/0x.js/src | |
parent | a322148631e910466d1a08dce55b5e46e76f8863 (diff) | |
download | dexon-0x-contracts-3e285c0ef109c380f5fcc872555d4cdaeee79384.tar.gz dexon-0x-contracts-3e285c0ef109c380f5fcc872555d4cdaeee79384.tar.zst dexon-0x-contracts-3e285c0ef109c380f5fcc872555d4cdaeee79384.zip |
OrderStateWatcher fixes for PR #488
Diffstat (limited to 'packages/0x.js/src')
-rw-r--r-- | packages/0x.js/src/order_watcher/event_watcher.ts | 2 | ||||
-rw-r--r-- | packages/0x.js/src/order_watcher/order_state_watcher.ts | 9 |
2 files changed, 5 insertions, 6 deletions
diff --git a/packages/0x.js/src/order_watcher/event_watcher.ts b/packages/0x.js/src/order_watcher/event_watcher.ts index deb1ffbff..d01542a8c 100644 --- a/packages/0x.js/src/order_watcher/event_watcher.ts +++ b/packages/0x.js/src/order_watcher/event_watcher.ts @@ -23,7 +23,7 @@ export class EventWatcher { private _intervalIdIfExists?: NodeJS.Timer; private _lastEvents: LogEntry[] = []; private _stateLayer: BlockParamLiteral; - constructor(web3Wrapper: Web3Wrapper, pollingIntervalIfExistsMs: undefined | number, stateLayer: BlockParamLiteral = BlockParamLiteral.Pending) { + constructor(web3Wrapper: Web3Wrapper, pollingIntervalIfExistsMs: undefined | number, stateLayer: BlockParamLiteral = BlockParamLiteral.Latest) { this._web3Wrapper = web3Wrapper; this._stateLayer = stateLayer; this._pollingIntervalMs = _.isUndefined(pollingIntervalIfExistsMs) 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 fcf3c351d..bfd250e21 100644 --- a/packages/0x.js/src/order_watcher/order_state_watcher.ts +++ b/packages/0x.js/src/order_watcher/order_state_watcher.ts @@ -76,7 +76,6 @@ export class OrderStateWatcher { private _balanceAndProxyAllowanceLazyStore: BalanceAndProxyAllowanceLazyStore; private _cleanupJobInterval: number; private _cleanupJobIntervalIdIfExists?: NodeJS.Timer; - private _stateLayer: BlockParamLiteral; constructor( web3Wrapper: Web3Wrapper, abiDecoder: AbiDecoder, @@ -87,13 +86,13 @@ export class OrderStateWatcher { this._abiDecoder = abiDecoder; this._web3Wrapper = web3Wrapper; const pollingIntervalIfExistsMs = _.isUndefined(config) ? undefined : config.eventPollingIntervalMs; - this._stateLayer = _.isUndefined(config) || _.isUndefined(config.stateLayer) - ? BlockParamLiteral.Pending + const stateLayer = _.isUndefined(config) || _.isUndefined(config.stateLayer) + ? BlockParamLiteral.Latest : config.stateLayer; - this._eventWatcher = new EventWatcher(web3Wrapper, pollingIntervalIfExistsMs, this._stateLayer); + this._eventWatcher = new EventWatcher(web3Wrapper, pollingIntervalIfExistsMs, stateLayer); this._balanceAndProxyAllowanceLazyStore = new BalanceAndProxyAllowanceLazyStore( token, - this._stateLayer, + stateLayer, ); this._orderFilledCancelledLazyStore = new OrderFilledCancelledLazyStore(exchange); this._orderStateUtils = new OrderStateUtils( |