diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-07-05 08:37:02 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-07-05 08:37:02 +0800 |
commit | 9c4f3b2cbae3c00b3189f3043e50c0caacfd9186 (patch) | |
tree | 151f1093cf55cb1f5c476b8405b48c05195dbb01 /src | |
parent | 4cb544f4f57c62ae40b8eb2dae1515c52f9a7ebf (diff) | |
download | dexon-0x-contracts-9c4f3b2cbae3c00b3189f3043e50c0caacfd9186.tar.gz dexon-0x-contracts-9c4f3b2cbae3c00b3189f3043e50c0caacfd9186.tar.zst dexon-0x-contracts-9c4f3b2cbae3c00b3189f3043e50c0caacfd9186.zip |
Rearrange methods in event utils
Diffstat (limited to 'src')
-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; - }, }; |