diff options
-rw-r--r-- | src/utils/event_utils.ts | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/utils/event_utils.ts b/src/utils/event_utils.ts index 5829ffe99..07418cbc4 100644 --- a/src/utils/event_utils.ts +++ b/src/utils/event_utils.ts @@ -5,6 +5,19 @@ import * as BigNumber from 'bignumber.js'; import promisify = require('es6-promisify'); export const eventUtils = { + wrapEventEmitter(event: ContractEventObj): ContractEventEmitter { + const watch = (eventCallback: EventCallback) => { + const bignumberWrappingEventCallback = eventUtils._getBigNumberWrappingEventCallback(eventCallback); + event.watch(bignumberWrappingEventCallback); + }; + const zeroExEvent = { + watch, + stopWatchingAsync: async () => { + await promisify(event.stopWatching, event)(); + }, + }; + return zeroExEvent; + }, /** * Wraps eventCallback function so that all the BigNumber arguments are wrapped in a newer version of BigNumber. * @param eventCallback Event callback function to be wrapped @@ -28,17 +41,4 @@ export const eventUtils = { }; return bignumberWrappingEventCallback; }, - wrapEventEmitter(event: ContractEventObj): ContractEventEmitter { - const watch = (eventCallback: EventCallback) => { - const bignumberWrappingEventCallback = eventUtils._getBigNumberWrappingEventCallback(eventCallback); - event.watch(bignumberWrappingEventCallback); - }; - const zeroExEvent = { - watch, - stopWatchingAsync: async () => { - await promisify(event.stopWatching, event)(); - }, - }; - return zeroExEvent; - }, }; |