aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeonid <logvinov.leon@gmail.com>2017-06-10 18:37:59 +0800
committerGitHub <noreply@github.com>2017-06-10 18:37:59 +0800
commit0e971fcc89735f2c0c681a43a53904890b965faa (patch)
treee69bcf1bdb24de596023dbf55f2a464600c36a38
parentb739ae24944876c28a2ff474993e72a7178b3d1b (diff)
parent1cff9fdf77e39aa707f2a13a00d07d73543f0f00 (diff)
downloaddexon-sol-tools-0e971fcc89735f2c0c681a43a53904890b965faa.tar
dexon-sol-tools-0e971fcc89735f2c0c681a43a53904890b965faa.tar.gz
dexon-sol-tools-0e971fcc89735f2c0c681a43a53904890b965faa.tar.bz2
dexon-sol-tools-0e971fcc89735f2c0c681a43a53904890b965faa.tar.lz
dexon-sol-tools-0e971fcc89735f2c0c681a43a53904890b965faa.tar.xz
dexon-sol-tools-0e971fcc89735f2c0c681a43a53904890b965faa.tar.zst
dexon-sol-tools-0e971fcc89735f2c0c681a43a53904890b965faa.zip
Merge pull request #55 from 0xProject/subscribe-async-tests
Add LogCancel test to subscribeAsync
-rw-r--r--test/exchange_wrapper_test.ts16
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 = {