diff options
author | Fabio Berger <me@fabioberger.com> | 2018-07-17 17:57:52 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-07-17 17:57:52 +0800 |
commit | 766ac3f1febcb6f6e4f6c20198283f01b278f671 (patch) | |
tree | c3ec88e1e85ac133e06231c294a0fefaa3c990e1 /packages/order-watcher | |
parent | 151ce6e3c77e43659899ce299ac9f1b37cf6a042 (diff) | |
download | dexon-sol-tools-766ac3f1febcb6f6e4f6c20198283f01b278f671.tar.gz dexon-sol-tools-766ac3f1febcb6f6e4f6c20198283f01b278f671.tar.zst dexon-sol-tools-766ac3f1febcb6f6e4f6c20198283f01b278f671.zip |
Remove blockRetention config
Diffstat (limited to 'packages/order-watcher')
-rw-r--r-- | packages/order-watcher/CHANGELOG.json | 5 | ||||
-rw-r--r-- | packages/order-watcher/src/order_watcher/event_watcher.ts | 6 | ||||
-rw-r--r-- | packages/order-watcher/src/order_watcher/order_watcher.ts | 4 | ||||
-rw-r--r-- | packages/order-watcher/src/types.ts | 2 |
4 files changed, 1 insertions, 16 deletions
diff --git a/packages/order-watcher/CHANGELOG.json b/packages/order-watcher/CHANGELOG.json index 1ce730d19..d80231dae 100644 --- a/packages/order-watcher/CHANGELOG.json +++ b/packages/order-watcher/CHANGELOG.json @@ -11,11 +11,6 @@ "pr": 825 }, { - "note": - "Add blockRetention config to OrderWatcher, so user can define how many blocks and they corresp. logs to store in-memory", - "pr": 875 - }, - { "note": "Fixed a bug that caused the incorrect block to be fetched via JSON-RPC within Blockstream", "pr": 875 } diff --git a/packages/order-watcher/src/order_watcher/event_watcher.ts b/packages/order-watcher/src/order_watcher/event_watcher.ts index d52c6a21e..1cd198a62 100644 --- a/packages/order-watcher/src/order_watcher/event_watcher.ts +++ b/packages/order-watcher/src/order_watcher/event_watcher.ts @@ -27,16 +27,13 @@ export class EventWatcher { private _pollingIntervalMs: number; private _stateLayer: BlockParamLiteral; private _isVerbose: boolean; - private _blockRetention: number; constructor( web3Wrapper: Web3Wrapper, pollingIntervalIfExistsMs: undefined | number, stateLayer: BlockParamLiteral = BlockParamLiteral.Latest, - blockRetention: number, isVerbose: boolean, ) { this._isVerbose = isVerbose; - this._blockRetention = blockRetention; this._web3Wrapper = web3Wrapper; this._stateLayer = stateLayer; this._pollingIntervalMs = _.isUndefined(pollingIntervalIfExistsMs) @@ -68,9 +65,6 @@ export class EventWatcher { this._web3Wrapper.getBlockAsync.bind(this._web3Wrapper), this._web3Wrapper.getLogsAsync.bind(this._web3Wrapper), this._onBlockAndLogStreamerError.bind(this), - { - blockRetention: this._blockRetention, - }, ); const catchAllLogFilter = {}; this._blockAndLogStreamerIfExists.addLogFilter(catchAllLogFilter); diff --git a/packages/order-watcher/src/order_watcher/order_watcher.ts b/packages/order-watcher/src/order_watcher/order_watcher.ts index 2fe012593..b09ba8d9d 100644 --- a/packages/order-watcher/src/order_watcher/order_watcher.ts +++ b/packages/order-watcher/src/order_watcher/order_watcher.ts @@ -61,7 +61,6 @@ 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 @@ -95,8 +94,7 @@ export class OrderWatcher { const stateLayer = _.isUndefined(config) || _.isUndefined(config.stateLayer) ? BlockParamLiteral.Latest : config.stateLayer; const isVerbose = !_.isUndefined(config) && !_.isUndefined(config.isVerbose) ? config.isVerbose : false; - const blockRetention = !_.isUndefined(config) && !_.isUndefined(config.blockRetention) ? config.blockRetention : DEFAULT_BLOCK_RETENTION; - this._eventWatcher = new EventWatcher(this._web3Wrapper, pollingIntervalIfExistsMs, stateLayer, blockRetention, isVerbose); + this._eventWatcher = new EventWatcher(this._web3Wrapper, pollingIntervalIfExistsMs, stateLayer, isVerbose); this._balanceAndProxyAllowanceLazyStore = new BalanceAndProxyAllowanceLazyStore( this._contractWrappers.token, stateLayer, diff --git a/packages/order-watcher/src/types.ts b/packages/order-watcher/src/types.ts index e9b8626b6..63e4e7848 100644 --- a/packages/order-watcher/src/types.ts +++ b/packages/order-watcher/src/types.ts @@ -14,7 +14,6 @@ export type EventWatcherCallback = (err: null | Error, log?: LogEntryEvent) => v * of an orders expiration. Default=0. * cleanupJobIntervalMs: How often to run a cleanup job which revalidates all the orders. Default=1hr. * stateLayer: Optional blockchain state layer OrderWatcher will monitor for new events. Default=latest. - * blockRetention: The numbers of blocks to retain in-memory, in order to handle block-reorgs. Default=100. */ export interface OrderWatcherConfig { stateLayer: BlockParamLiteral; @@ -23,7 +22,6 @@ export interface OrderWatcherConfig { expirationMarginMs?: number; cleanupJobIntervalMs?: number; isVerbose?: boolean; - blockRetention?: number; } export type OnOrderStateChangeCallback = (err: Error | null, orderState?: OrderState) => void; |