aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
Diffstat (limited to 'packages')
-rw-r--r--packages/0x.js/src/contract_wrappers/exchange_wrapper.ts4
-rw-r--r--packages/0x.js/test/exchange_wrapper_test.ts12
2 files changed, 8 insertions, 8 deletions
diff --git a/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts b/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts
index 9ab03454c..22338d70f 100644
--- a/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts
+++ b/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts
@@ -658,9 +658,9 @@ export class ExchangeWrapper extends ContractWrapper {
* @param callback Callback that gets called when a log is added/removed
* @return Subscription token used later to unsubscribe
*/
- public async subscribeAsync<ArgsType extends ExchangeContractEventArgs>(
+ public subscribe<ArgsType extends ExchangeContractEventArgs>(
eventName: ExchangeEvents, indexFilterValues: IndexedFilterValues,
- callback: EventCallback<ArgsType>): Promise<string> {
+ callback: EventCallback<ArgsType>): string {
assert.doesBelongToStringEnum('eventName', eventName, ExchangeEvents);
assert.doesConformToSchema('indexFilterValues', indexFilterValues, schemas.indexFilterValuesSchema);
assert.isFunction('callback', callback);
diff --git a/packages/0x.js/test/exchange_wrapper_test.ts b/packages/0x.js/test/exchange_wrapper_test.ts
index c1f9316c4..8b89baa67 100644
--- a/packages/0x.js/test/exchange_wrapper_test.ts
+++ b/packages/0x.js/test/exchange_wrapper_test.ts
@@ -617,7 +617,7 @@ describe('ExchangeWrapper', () => {
});
});
});
- describe('#subscribeAsync', () => {
+ describe('#subscribe', () => {
const indexFilterValues = {};
const shouldThrowOnInsufficientBalanceOrAllowance = true;
let makerTokenAddress: string;
@@ -656,7 +656,7 @@ describe('ExchangeWrapper', () => {
expect(logEvent.log.event).to.be.equal(ExchangeEvents.LogFill);
done();
};
- await zeroEx.exchange.subscribeAsync(
+ zeroEx.exchange.subscribe(
ExchangeEvents.LogFill, indexFilterValues, callback,
);
await zeroEx.exchange.fillOrderAsync(
@@ -672,7 +672,7 @@ describe('ExchangeWrapper', () => {
expect(logEvent.log.event).to.be.equal(ExchangeEvents.LogCancel);
done();
};
- await zeroEx.exchange.subscribeAsync(
+ zeroEx.exchange.subscribe(
ExchangeEvents.LogCancel, indexFilterValues, callback,
);
await zeroEx.exchange.cancelOrderAsync(signedOrder, cancelTakerAmountInBaseUnits);
@@ -684,7 +684,7 @@ describe('ExchangeWrapper', () => {
const callbackNeverToBeCalled = (err: Error, logEvent: DecodedLogEvent<LogFillContractEventArgs>) => {
done(new Error('Expected this subscription to have been cancelled'));
};
- await zeroEx.exchange.subscribeAsync(
+ zeroEx.exchange.subscribe(
ExchangeEvents.LogFill, indexFilterValues, callbackNeverToBeCalled,
);
@@ -695,7 +695,7 @@ describe('ExchangeWrapper', () => {
expect(logEvent.log.event).to.be.equal(ExchangeEvents.LogFill);
done();
};
- await zeroEx.exchange.subscribeAsync(
+ zeroEx.exchange.subscribe(
ExchangeEvents.LogFill, indexFilterValues, callback,
);
await zeroEx.exchange.fillOrderAsync(
@@ -709,7 +709,7 @@ describe('ExchangeWrapper', () => {
const callbackNeverToBeCalled = (err: Error, logEvent: DecodedLogEvent<LogFillContractEventArgs>) => {
done(new Error('Expected this subscription to have been cancelled'));
};
- const subscriptionToken = await zeroEx.exchange.subscribeAsync(
+ const subscriptionToken = zeroEx.exchange.subscribe(
ExchangeEvents.LogFill, indexFilterValues, callbackNeverToBeCalled,
);
zeroEx.exchange.unsubscribe(subscriptionToken);