aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-11-10 12:05:46 +0800
committerFabio Berger <me@fabioberger.com>2017-11-10 12:05:46 +0800
commit960c83315b60398df7ca7ac0a3f4ae5dde7771f1 (patch)
tree7ec1ebcaa92f4933ac924b65d8c74a8067f30448
parentf9c84fb6f4a89e257c022feefefd4cb2978b71ce (diff)
downloaddexon-sol-tools-960c83315b60398df7ca7ac0a3f4ae5dde7771f1.tar
dexon-sol-tools-960c83315b60398df7ca7ac0a3f4ae5dde7771f1.tar.gz
dexon-sol-tools-960c83315b60398df7ca7ac0a3f4ae5dde7771f1.tar.bz2
dexon-sol-tools-960c83315b60398df7ca7ac0a3f4ae5dde7771f1.tar.lz
dexon-sol-tools-960c83315b60398df7ca7ac0a3f4ae5dde7771f1.tar.xz
dexon-sol-tools-960c83315b60398df7ca7ac0a3f4ae5dde7771f1.tar.zst
dexon-sol-tools-960c83315b60398df7ca7ac0a3f4ae5dde7771f1.zip
Add assertion
-rw-r--r--src/order_watcher/event_watcher.ts2
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,