diff options
author | Fabio Berger <me@fabioberger.com> | 2017-11-13 09:50:42 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-13 09:50:42 +0800 |
commit | b0be323e899ea7be42b6c695b4fd6d526070b213 (patch) | |
tree | 86042b06c407b388e39be690d9a40db218f82675 /test/exchange_wrapper_test.ts | |
parent | 1392a855bb17981f7680548a23062842fb6dc4e0 (diff) | |
parent | a22661670f105a2bf527aca0e803689e0302ed17 (diff) | |
download | dexon-0x-contracts-b0be323e899ea7be42b6c695b4fd6d526070b213.tar.gz dexon-0x-contracts-b0be323e899ea7be42b6c695b4fd6d526070b213.tar.zst dexon-0x-contracts-b0be323e899ea7be42b6c695b4fd6d526070b213.zip |
Merge pull request #205 from 0xProject/orderWatcher
Order watcher
Diffstat (limited to 'test/exchange_wrapper_test.ts')
-rw-r--r-- | test/exchange_wrapper_test.ts | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/test/exchange_wrapper_test.ts b/test/exchange_wrapper_test.ts index 654f626c6..26b8c1e0e 100644 --- a/test/exchange_wrapper_test.ts +++ b/test/exchange_wrapper_test.ts @@ -11,13 +11,13 @@ import { SignedOrder, SubscriptionOpts, ExchangeEvents, - ContractEvent, ExchangeContractErrs, OrderCancellationRequest, OrderFillRequest, LogFillContractEventArgs, LogCancelContractEventArgs, LogEvent, + DecodedLogEvent, } from '../src'; import {DoneCallback, BlockParamLiteral} from '../src/types'; import {FillScenarios} from './utils/fill_scenarios'; @@ -70,7 +70,7 @@ describe('ExchangeWrapper', () => { takerTokenAddress = takerToken.address; }); describe('#batchFillOrKillAsync', () => { - it('successfuly batch fillOrKill', async () => { + it('successfully batch fillOrKill', async () => { const fillableAmount = new BigNumber(5); const partialFillTakerAmount = new BigNumber(2); const signedOrder = await fillScenarios.createFillableSignedOrderAsync( @@ -647,7 +647,8 @@ describe('ExchangeWrapper', () => { // Source: https://github.com/mochajs/mocha/issues/2407 it('Should receive the LogFill event when an order is filled', (done: DoneCallback) => { (async () => { - const callback = (err: Error, logEvent: LogEvent<LogFillContractEventArgs>) => { + + const callback = (err: Error, logEvent: DecodedLogEvent<LogFillContractEventArgs>) => { expect(logEvent.event).to.be.equal(ExchangeEvents.LogFill); done(); }; @@ -662,7 +663,8 @@ describe('ExchangeWrapper', () => { }); it('Should receive the LogCancel event when an order is cancelled', (done: DoneCallback) => { (async () => { - const callback = (err: Error, logEvent: LogEvent<LogCancelContractEventArgs>) => { + + const callback = (err: Error, logEvent: DecodedLogEvent<LogCancelContractEventArgs>) => { expect(logEvent.event).to.be.equal(ExchangeEvents.LogCancel); done(); }; @@ -674,7 +676,8 @@ describe('ExchangeWrapper', () => { }); it('Outstanding subscriptions are cancelled when zeroEx.setProviderAsync called', (done: DoneCallback) => { (async () => { - const callbackNeverToBeCalled = (err: Error, logEvent: LogEvent<LogFillContractEventArgs>) => { + + const callbackNeverToBeCalled = (err: Error, logEvent: DecodedLogEvent<LogFillContractEventArgs>) => { done(new Error('Expected this subscription to have been cancelled')); }; await zeroEx.exchange.subscribeAsync( @@ -684,7 +687,7 @@ describe('ExchangeWrapper', () => { const newProvider = web3Factory.getRpcProvider(); await zeroEx.setProviderAsync(newProvider); - const callback = (err: Error, logEvent: LogEvent<LogFillContractEventArgs>) => { + const callback = (err: Error, logEvent: DecodedLogEvent<LogFillContractEventArgs>) => { expect(logEvent.event).to.be.equal(ExchangeEvents.LogFill); done(); }; @@ -699,7 +702,7 @@ describe('ExchangeWrapper', () => { }); it('Should cancel subscription when unsubscribe called', (done: DoneCallback) => { (async () => { - const callbackNeverToBeCalled = (err: Error, logEvent: LogEvent<LogFillContractEventArgs>) => { + const callbackNeverToBeCalled = (err: Error, logEvent: DecodedLogEvent<LogFillContractEventArgs>) => { done(new Error('Expected this subscription to have been cancelled')); }; const subscriptionToken = await zeroEx.exchange.subscribeAsync( |