diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-07-18 21:27:38 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-07-18 21:27:38 +0800 |
commit | dad557164ea4ccc012243d43df013078a7c37eb6 (patch) | |
tree | 88e8477941dc0c98273fcb054086b2e89d034e19 /packages/order-watcher/src/order_watcher/order_watcher.ts | |
parent | acff177c547dee049b97e4b051fe22e1efaf992c (diff) | |
parent | f3241ff86a0d99f4291c5a5f4eaaa5ebe1736da0 (diff) | |
download | dexon-sol-tools-dad557164ea4ccc012243d43df013078a7c37eb6.tar dexon-sol-tools-dad557164ea4ccc012243d43df013078a7c37eb6.tar.gz dexon-sol-tools-dad557164ea4ccc012243d43df013078a7c37eb6.tar.bz2 dexon-sol-tools-dad557164ea4ccc012243d43df013078a7c37eb6.tar.lz dexon-sol-tools-dad557164ea4ccc012243d43df013078a7c37eb6.tar.xz dexon-sol-tools-dad557164ea4ccc012243d43df013078a7c37eb6.tar.zst dexon-sol-tools-dad557164ea4ccc012243d43df013078a7c37eb6.zip |
Merge branch 'v2-prototype' into feature/order-watcher-v2
Diffstat (limited to 'packages/order-watcher/src/order_watcher/order_watcher.ts')
-rw-r--r-- | packages/order-watcher/src/order_watcher/order_watcher.ts | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/packages/order-watcher/src/order_watcher/order_watcher.ts b/packages/order-watcher/src/order_watcher/order_watcher.ts index af479f32d..0ad3267d8 100644 --- a/packages/order-watcher/src/order_watcher/order_watcher.ts +++ b/packages/order-watcher/src/order_watcher/order_watcher.ts @@ -58,7 +58,6 @@ interface OrderStateByOrderHash { } const DEFAULT_ORDER_WATCHER_CONFIG: OrderWatcherConfig = { - stateLayer: BlockParamLiteral.Latest, orderExpirationCheckingIntervalMs: 50, eventPollingIntervalMs: 200, expirationMarginMs: 0, @@ -66,6 +65,7 @@ const DEFAULT_ORDER_WATCHER_CONFIG: OrderWatcherConfig = { cleanupJobIntervalMs: 1000 * 60 * 60, // 1h isVerbose: true, }; +const STATE_LAYER = BlockParamLiteral.Latest; /** * This class includes all the functionality related to watching a set of orders @@ -107,24 +107,16 @@ export class OrderWatcher { [artifacts.EtherToken.abi, artifacts.Exchange.abi], ); const contractWrappers = new ContractWrappers(provider, { networkId }); - this._eventWatcher = new EventWatcher( - provider, - config.eventPollingIntervalMs, - config.stateLayer, - config.isVerbose, - ); + this._eventWatcher = new EventWatcher(provider, config.eventPollingIntervalMs, STATE_LAYER, config.isVerbose); const balanceAndProxyAllowanceFetcher = new AssetBalanceAndProxyAllowanceFetcher( contractWrappers.erc20Token, contractWrappers.erc721Token, - config.stateLayer, + STATE_LAYER, ); this._balanceAndProxyAllowanceLazyStore = new BalanceAndProxyAllowanceLazyStore( balanceAndProxyAllowanceFetcher, ); - const orderFilledCancelledFetcher = new OrderFilledCancelledFetcher( - contractWrappers.exchange, - config.stateLayer, - ); + const orderFilledCancelledFetcher = new OrderFilledCancelledFetcher(contractWrappers.exchange, STATE_LAYER); this._orderFilledCancelledLazyStore = new OrderFilledCancelledLazyStore(orderFilledCancelledFetcher); this._orderStateUtils = new OrderStateUtils(balanceAndProxyAllowanceFetcher, orderFilledCancelledFetcher); const expirationMarginIfExistsMs = _.isUndefined(config) ? undefined : config.expirationMarginMs; |