diff options
author | Fabio Berger <me@fabioberger.com> | 2017-11-10 05:42:06 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2017-11-10 05:42:06 +0800 |
commit | 530f5a700e6e7d8478e71736ae3e9b37a92009d6 (patch) | |
tree | 9cf0ad127fae6b0f03790b6223aa3c0daf07e008 | |
parent | 441c1f9ab77bbbaef7186bf52964cbfdf7c12208 (diff) | |
parent | d98d8859248b3ba926f1f5a7360468b3c24e730d (diff) | |
download | dexon-sol-tools-530f5a700e6e7d8478e71736ae3e9b37a92009d6.tar dexon-sol-tools-530f5a700e6e7d8478e71736ae3e9b37a92009d6.tar.gz dexon-sol-tools-530f5a700e6e7d8478e71736ae3e9b37a92009d6.tar.bz2 dexon-sol-tools-530f5a700e6e7d8478e71736ae3e9b37a92009d6.tar.lz dexon-sol-tools-530f5a700e6e7d8478e71736ae3e9b37a92009d6.tar.xz dexon-sol-tools-530f5a700e6e7d8478e71736ae3e9b37a92009d6.tar.zst dexon-sol-tools-530f5a700e6e7d8478e71736ae3e9b37a92009d6.zip |
Merge branch 'orderWatcher' of github.com:0xProject/0x.js into orderWatcher
* 'orderWatcher' of github.com:0xProject/0x.js:
Fix namings
-rw-r--r-- | src/order_watcher/event_watcher.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/order_watcher/event_watcher.ts b/src/order_watcher/event_watcher.ts index 205885f96..7d3719282 100644 --- a/src/order_watcher/event_watcher.ts +++ b/src/order_watcher/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._lastEvents = 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> { |