OrderStateWatcher fixes for PR #488

This commit is contained in:
Ara Kevonian
2018-03-30 09:59:57 -07:00
parent a322148631
commit 3e285c0ef1
2 changed files with 5 additions and 6 deletions

View File

@@ -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)

View File

@@ -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(