aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Evans <jacob@dekz.net>2017-11-14 23:56:57 +0800
committerJacob Evans <jacob@dekz.net>2017-11-14 23:56:57 +0800
commita12069f03fb1c1c93884c2e168917d229f7864e9 (patch)
tree6dd3547b22e8a011f35f2e81d6a664320cb5be01
parentbc61b920706224f0bd9c82a2e5355dae3fcc0fa9 (diff)
downloaddexon-sol-tools-a12069f03fb1c1c93884c2e168917d229f7864e9.tar
dexon-sol-tools-a12069f03fb1c1c93884c2e168917d229f7864e9.tar.gz
dexon-sol-tools-a12069f03fb1c1c93884c2e168917d229f7864e9.tar.bz2
dexon-sol-tools-a12069f03fb1c1c93884c2e168917d229f7864e9.tar.lz
dexon-sol-tools-a12069f03fb1c1c93884c2e168917d229f7864e9.tar.xz
dexon-sol-tools-a12069f03fb1c1c93884c2e168917d229f7864e9.tar.zst
dexon-sol-tools-a12069f03fb1c1c93884c2e168917d229f7864e9.zip
Callback for subscribe no longer supports an Async Callback
-rw-r--r--packages/0x.js/src/contract_wrappers/contract_wrapper.ts3
-rw-r--r--packages/0x.js/src/index.ts2
-rw-r--r--packages/0x.js/src/order_watcher/event_watcher.ts2
-rw-r--r--packages/0x.js/src/types.ts9
4 files changed, 4 insertions, 12 deletions
diff --git a/packages/0x.js/src/contract_wrappers/contract_wrapper.ts b/packages/0x.js/src/contract_wrappers/contract_wrapper.ts
index 7997b1647..bd65c8eb3 100644
--- a/packages/0x.js/src/contract_wrappers/contract_wrapper.ts
+++ b/packages/0x.js/src/contract_wrappers/contract_wrapper.ts
@@ -52,8 +52,7 @@ export class ContractWrapper {
throw new Error(ZeroExError.SubscriptionNotFound);
}
if (!_.isUndefined(err)) {
- const callback = this._filterCallbacks[filterToken];
- callback(err, undefined);
+ this._filterCallbacks[filterToken](err, undefined);
}
delete this._filters[filterToken];
delete this._filterCallbacks[filterToken];
diff --git a/packages/0x.js/src/index.ts b/packages/0x.js/src/index.ts
index 1b3e893ba..e529e2858 100644
--- a/packages/0x.js/src/index.ts
+++ b/packages/0x.js/src/index.ts
@@ -6,8 +6,6 @@ export {
ECSignature,
ZeroExError,
EventCallback,
- EventCallbackAsync,
- EventCallbackSync,
ExchangeContractErrs,
ContractEvent,
Token,
diff --git a/packages/0x.js/src/order_watcher/event_watcher.ts b/packages/0x.js/src/order_watcher/event_watcher.ts
index 81529a98c..c39431f6d 100644
--- a/packages/0x.js/src/order_watcher/event_watcher.ts
+++ b/packages/0x.js/src/order_watcher/event_watcher.ts
@@ -81,7 +81,7 @@ export class EventWatcher {
...log,
};
if (!_.isUndefined(this._intervalIdIfExists)) {
- await callback(logEvent);
+ callback(logEvent);
}
}
}
diff --git a/packages/0x.js/src/types.ts b/packages/0x.js/src/types.ts
index 11b5d8569..04dfe3b0d 100644
--- a/packages/0x.js/src/types.ts
+++ b/packages/0x.js/src/types.ts
@@ -42,13 +42,8 @@ export type OrderValues = [BigNumber, BigNumber, BigNumber,
export type LogEvent = Web3.LogEntryEvent;
export type DecodedLogEvent<ArgsType> = Web3.DecodedLogEntryEvent<ArgsType>;
-export type EventCallbackAsync<ArgsType> = (err: null|Error, log?: DecodedLogEvent<ArgsType>) => Promise<void>;
-export type EventCallbackSync<ArgsType> = (err: null|Error, log?: DecodedLogEvent<ArgsType>) => void;
-export type EventCallback<ArgsType> = EventCallbackSync<ArgsType>|EventCallbackAsync<ArgsType>;
-
-export type EventWatcherCallbackSync = (log: LogEvent) => void;
-export type EventWatcherCallbackAsync = (log: LogEvent) => Promise<void>;
-export type EventWatcherCallback = EventWatcherCallbackSync|EventWatcherCallbackAsync;
+export type EventCallback<ArgsType> = (err: null|Error, log?: DecodedLogEvent<ArgsType>) => void;
+export type EventWatcherCallback = (log: LogEvent) => void;
export interface ExchangeContract extends Web3.ContractInstance {
isValidSignature: {