aboutsummaryrefslogtreecommitdiffstats
path: root/src/order_watcher
diff options
context:
space:
mode:
Diffstat (limited to 'src/order_watcher')
-rw-r--r--src/order_watcher/event_watcher.ts7
-rw-r--r--src/order_watcher/order_state_watcher.ts8
2 files changed, 6 insertions, 9 deletions
diff --git a/src/order_watcher/event_watcher.ts b/src/order_watcher/event_watcher.ts
index 5303bb651..7e27d5e79 100644
--- a/src/order_watcher/event_watcher.ts
+++ b/src/order_watcher/event_watcher.ts
@@ -29,13 +29,10 @@ export class EventWatcher {
private _pollingIntervalMs: number;
private _intervalIdIfExists?: NodeJS.Timer;
private _lastEvents: Web3.LogEntry[] = [];
- private _numConfirmations: number;
private _blockStore: BlockStore;
- constructor(web3Wrapper: Web3Wrapper, blockStore: BlockStore, pollingIntervalMs: undefined|number,
- numConfirmations: number) {
+ constructor(web3Wrapper: Web3Wrapper, blockStore: BlockStore, pollingIntervalMs: undefined|number) {
this._web3Wrapper = web3Wrapper;
this._blockStore = blockStore;
- this._numConfirmations = numConfirmations;
this._pollingIntervalMs = _.isUndefined(pollingIntervalMs) ?
DEFAULT_EVENT_POLLING_INTERVAL :
pollingIntervalMs;
@@ -71,7 +68,7 @@ export class EventWatcher {
this._lastEvents = pendingEvents;
}
private async _getEventsAsync(): Promise<Web3.LogEntry[]> {
- const blockNumber = this._blockStore.getBlockNumberWithNConfirmations(this._numConfirmations);
+ const blockNumber = this._blockStore.getBlockNumber();
const eventFilter = {
fromBlock: blockNumber,
toBlock: blockNumber,
diff --git a/src/order_watcher/order_state_watcher.ts b/src/order_watcher/order_state_watcher.ts
index e6250cef5..0f5b5c30c 100644
--- a/src/order_watcher/order_state_watcher.ts
+++ b/src/order_watcher/order_state_watcher.ts
@@ -78,15 +78,15 @@ export class OrderStateWatcher {
const numConfirmations = (_.isUndefined(config) || _.isUndefined(config.numConfirmations)) ?
DEFAULT_NUM_CONFIRMATIONS :
config.numConfirmations;
- this._blockStore = new BlockStore(this._web3Wrapper, blockPollingIntervalMs);
+ this._blockStore = new BlockStore(numConfirmations, this._web3Wrapper, blockPollingIntervalMs);
this._eventWatcher = new EventWatcher(
- web3Wrapper, this._blockStore, eventPollingIntervalMs, numConfirmations,
+ web3Wrapper, this._blockStore, eventPollingIntervalMs,
);
this._balanceAndProxyAllowanceLazyStore = new BalanceAndProxyAllowanceLazyStore(
- this._token, this._blockStore, numConfirmations,
+ this._token, this._blockStore,
);
this._orderFilledCancelledLazyStore = new OrderFilledCancelledLazyStore(
- this._exchange, this._blockStore, numConfirmations,
+ this._exchange, this._blockStore,
);
this._orderStateUtils = new OrderStateUtils(
this._balanceAndProxyAllowanceLazyStore, this._orderFilledCancelledLazyStore,