diff options
author | Leonid <logvinov.leon@gmail.com> | 2017-06-10 18:37:59 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-10 18:37:59 +0800 |
commit | 0e971fcc89735f2c0c681a43a53904890b965faa (patch) | |
tree | e69bcf1bdb24de596023dbf55f2a464600c36a38 | |
parent | b739ae24944876c28a2ff474993e72a7178b3d1b (diff) | |
parent | 1cff9fdf77e39aa707f2a13a00d07d73543f0f00 (diff) | |
download | dexon-0x-contracts-0e971fcc89735f2c0c681a43a53904890b965faa.tar.gz dexon-0x-contracts-0e971fcc89735f2c0c681a43a53904890b965faa.tar.zst dexon-0x-contracts-0e971fcc89735f2c0c681a43a53904890b965faa.zip |
Merge pull request #55 from 0xProject/subscribe-async-tests
Add LogCancel test to subscribeAsync
-rw-r--r-- | test/exchange_wrapper_test.ts | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/exchange_wrapper_test.ts b/test/exchange_wrapper_test.ts index 6a511e68d..1b97d7b05 100644 --- a/test/exchange_wrapper_test.ts +++ b/test/exchange_wrapper_test.ts @@ -643,6 +643,22 @@ describe('ExchangeWrapper', () => { ); })(); }); + it('Should receive the LogCancel event when an order is cancelled', (done: DoneCallback) => { + (async () => { + const subscriptionOpts: SubscriptionOpts = { + fromBlock: 0, + toBlock: 'latest', + }; + await zeroEx.exchange.subscribeAsync(ExchangeEvents.LogCancel, subscriptionOpts, + indexFilterValues, (err: Error, event: ContractEvent) => { + expect(err).to.be.null(); + expect(event).to.not.be.undefined(); + done(); + }); + const cancelTakerAmountInBaseUnits = new BigNumber(1); + await zeroEx.exchange.cancelOrderAsync(signedOrder, cancelTakerAmountInBaseUnits); + })(); + }); it('Outstanding subscriptions are cancelled when zeroEx.setProviderAsync called', (done: DoneCallback) => { (async () => { const subscriptionOpts: SubscriptionOpts = { |