From 960c83315b60398df7ca7ac0a3f4ae5dde7771f1 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Thu, 9 Nov 2017 23:05:46 -0500 Subject: Add assertion --- src/order_watcher/event_watcher.ts | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/order_watcher') 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, -- cgit