diff options
author | Fabio Berger <me@fabioberger.com> | 2017-11-10 12:05:46 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2017-11-10 12:05:46 +0800 |
commit | 960c83315b60398df7ca7ac0a3f4ae5dde7771f1 (patch) | |
tree | 7ec1ebcaa92f4933ac924b65d8c74a8067f30448 /src/order_watcher/event_watcher.ts | |
parent | f9c84fb6f4a89e257c022feefefd4cb2978b71ce (diff) | |
download | dexon-0x-contracts-960c83315b60398df7ca7ac0a3f4ae5dde7771f1.tar dexon-0x-contracts-960c83315b60398df7ca7ac0a3f4ae5dde7771f1.tar.gz dexon-0x-contracts-960c83315b60398df7ca7ac0a3f4ae5dde7771f1.tar.bz2 dexon-0x-contracts-960c83315b60398df7ca7ac0a3f4ae5dde7771f1.tar.lz dexon-0x-contracts-960c83315b60398df7ca7ac0a3f4ae5dde7771f1.tar.xz dexon-0x-contracts-960c83315b60398df7ca7ac0a3f4ae5dde7771f1.tar.zst dexon-0x-contracts-960c83315b60398df7ca7ac0a3f4ae5dde7771f1.zip |
Add assertion
Diffstat (limited to 'src/order_watcher/event_watcher.ts')
-rw-r--r-- | src/order_watcher/event_watcher.ts | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/order_watcher/event_watcher.ts b/src/order_watcher/event_watcher.ts index 4cb741617..786470f1d 100644 --- a/src/order_watcher/event_watcher.ts +++ b/src/order_watcher/event_watcher.ts @@ -4,6 +4,7 @@ import {Web3Wrapper} from '../web3_wrapper'; import {BlockParamLiteral, EventCallback, EventWatcherCallback} from '../types'; import {AbiDecoder} from '../utils/abi_decoder'; import {intervalUtils} from '../utils/interval_utils'; +import {assert} from '../utils/assert'; const DEFAULT_EVENT_POLLING_INTERVAL = 200; @@ -22,6 +23,7 @@ export class EventWatcher { pollingIntervalMs; } public subscribe(callback: EventWatcherCallback): void { + assert.isFunction('callback', callback); this._callbackIfExistsAsync = callback; this._intervalIdIfExists = intervalUtils.setAsyncExcludingInterval( this._pollForMempoolEventsAsync.bind(this), this._pollingIntervalMs, |