aboutsummaryrefslogtreecommitdiffstats
path: root/packages/order-watcher/src/order_watcher/order_watcher.ts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-07-14 01:44:21 +0800
committerFabio Berger <me@fabioberger.com>2018-07-14 01:44:21 +0800
commitced68e4e022eb1020a4d15ab9a64552b4f92744a (patch)
tree0e8daaea34e7aa7339ea2961bf7de664d60f434d /packages/order-watcher/src/order_watcher/order_watcher.ts
parent9b387b8ec3c543b5c96d1887550797a2bb90fe94 (diff)
downloaddexon-sol-tools-ced68e4e022eb1020a4d15ab9a64552b4f92744a.tar
dexon-sol-tools-ced68e4e022eb1020a4d15ab9a64552b4f92744a.tar.gz
dexon-sol-tools-ced68e4e022eb1020a4d15ab9a64552b4f92744a.tar.bz2
dexon-sol-tools-ced68e4e022eb1020a4d15ab9a64552b4f92744a.tar.lz
dexon-sol-tools-ced68e4e022eb1020a4d15ab9a64552b4f92744a.tar.xz
dexon-sol-tools-ced68e4e022eb1020a4d15ab9a64552b4f92744a.tar.zst
dexon-sol-tools-ced68e4e022eb1020a4d15ab9a64552b4f92744a.zip
Expose Blockstreams blockRetention config as an OrderWatcher config
Diffstat (limited to 'packages/order-watcher/src/order_watcher/order_watcher.ts')
-rw-r--r--packages/order-watcher/src/order_watcher/order_watcher.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/order-watcher/src/order_watcher/order_watcher.ts b/packages/order-watcher/src/order_watcher/order_watcher.ts
index b09ba8d9d..2fe012593 100644
--- a/packages/order-watcher/src/order_watcher/order_watcher.ts
+++ b/packages/order-watcher/src/order_watcher/order_watcher.ts
@@ -61,6 +61,7 @@ interface OrderStateByOrderHash {
// tslint:disable-next-line:custom-no-magic-numbers
const DEFAULT_CLEANUP_JOB_INTERVAL_MS = 1000 * 60 * 60; // 1h
+const DEFAULT_BLOCK_RETENTION = 100;
/**
* This class includes all the functionality related to watching a set of orders
@@ -94,7 +95,8 @@ export class OrderWatcher {
const stateLayer =
_.isUndefined(config) || _.isUndefined(config.stateLayer) ? BlockParamLiteral.Latest : config.stateLayer;
const isVerbose = !_.isUndefined(config) && !_.isUndefined(config.isVerbose) ? config.isVerbose : false;
- this._eventWatcher = new EventWatcher(this._web3Wrapper, pollingIntervalIfExistsMs, stateLayer, isVerbose);
+ const blockRetention = !_.isUndefined(config) && !_.isUndefined(config.blockRetention) ? config.blockRetention : DEFAULT_BLOCK_RETENTION;
+ this._eventWatcher = new EventWatcher(this._web3Wrapper, pollingIntervalIfExistsMs, stateLayer, blockRetention, isVerbose);
this._balanceAndProxyAllowanceLazyStore = new BalanceAndProxyAllowanceLazyStore(
this._contractWrappers.token,
stateLayer,