diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-11-10 05:37:00 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-11-10 05:37:00 +0800 |
commit | d98d8859248b3ba926f1f5a7360468b3c24e730d (patch) | |
tree | 3baab20e31ee881aa0f37e02ccca67b7b8960913 /src | |
parent | 6aa91d89e0fd02601f7e4df86e8499edc00316ce (diff) | |
download | dexon-sol-tools-d98d8859248b3ba926f1f5a7360468b3c24e730d.tar dexon-sol-tools-d98d8859248b3ba926f1f5a7360468b3c24e730d.tar.gz dexon-sol-tools-d98d8859248b3ba926f1f5a7360468b3c24e730d.tar.bz2 dexon-sol-tools-d98d8859248b3ba926f1f5a7360468b3c24e730d.tar.lz dexon-sol-tools-d98d8859248b3ba926f1f5a7360468b3c24e730d.tar.xz dexon-sol-tools-d98d8859248b3ba926f1f5a7360468b3c24e730d.tar.zst dexon-sol-tools-d98d8859248b3ba926f1f5a7360468b3c24e730d.zip |
Fix namings
Diffstat (limited to 'src')
-rw-r--r-- | src/mempool/event_watcher.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mempool/event_watcher.ts b/src/mempool/event_watcher.ts index 3f40606e7..398b74ddc 100644 --- a/src/mempool/event_watcher.ts +++ b/src/mempool/event_watcher.ts @@ -31,7 +31,7 @@ export class EventWatcher { intervalUtils.clearAsyncExcludingInterval(this._intervalId); } private async _pollForMempoolEventsAsync(numConfirmations: number): Promise<void> { - const pendingEvents = await this._getMempoolEventsAsync(numConfirmations); + const pendingEvents = await this._getEventsAsync(numConfirmations); if (pendingEvents.length === 0) { // HACK: Sometimes when node rebuilds the pending block we get back the empty result. // We don't want to emit a lot of removal events and bring them back after a couple of miliseconds, @@ -46,7 +46,7 @@ export class EventWatcher { await this._emitDifferencesAsync(newEvents, isRemoved); this._lastMempoolEvents = pendingEvents; } - private async _getMempoolEventsAsync(numConfirmations: number): Promise<Web3.LogEntry[]> { + private async _getEventsAsync(numConfirmations: number): Promise<Web3.LogEntry[]> { let fromBlock: BlockParamLiteral|number; let toBlock: BlockParamLiteral|number; if (numConfirmations === 0) { @@ -56,12 +56,12 @@ export class EventWatcher { toBlock = await this._web3Wrapper.getBlockNumberAsync(); fromBlock = toBlock - numConfirmations; } - const mempoolFilter = { + const eventFilter = { fromBlock, toBlock, }; - const pendingEvents = await this._web3Wrapper.getLogsAsync(mempoolFilter); - return pendingEvents; + const events = await this._web3Wrapper.getLogsAsync(eventFilter); + return events; } // TODO: Let's emit out own LogEntry type that has property isRemoved rather then removed private async _emitDifferencesAsync(logs: Web3.LogEntry[], isRemoved: boolean): Promise<void> { |