diff options
author | Alex Browne <stephenalexbrowne@gmail.com> | 2018-10-16 08:35:25 +0800 |
---|---|---|
committer | Alex Browne <stephenalexbrowne@gmail.com> | 2018-10-16 08:35:25 +0800 |
commit | 6f8e98e53727a1efc08800017cf2bde38884c982 (patch) | |
tree | d58aa9662d32688f17675d70ed77be2170f54e06 /packages/contract-wrappers/test | |
parent | e093864bff4b9e6191d6ed4d7fe8ce9c60c5c367 (diff) | |
download | dexon-sol-tools-6f8e98e53727a1efc08800017cf2bde38884c982.tar dexon-sol-tools-6f8e98e53727a1efc08800017cf2bde38884c982.tar.gz dexon-sol-tools-6f8e98e53727a1efc08800017cf2bde38884c982.tar.bz2 dexon-sol-tools-6f8e98e53727a1efc08800017cf2bde38884c982.tar.lz dexon-sol-tools-6f8e98e53727a1efc08800017cf2bde38884c982.tar.xz dexon-sol-tools-6f8e98e53727a1efc08800017cf2bde38884c982.tar.zst dexon-sol-tools-6f8e98e53727a1efc08800017cf2bde38884c982.zip |
In contract-wrappers, remove setProvider and add unsubscribeAll method.
Diffstat (limited to 'packages/contract-wrappers/test')
4 files changed, 8 insertions, 8 deletions
diff --git a/packages/contract-wrappers/test/erc20_wrapper_test.ts b/packages/contract-wrappers/test/erc20_wrapper_test.ts index 37a824120..2cfa9f0b2 100644 --- a/packages/contract-wrappers/test/erc20_wrapper_test.ts +++ b/packages/contract-wrappers/test/erc20_wrapper_test.ts @@ -533,7 +533,7 @@ describe('ERC20Wrapper', () => { ); })().catch(done); }); - it('Outstanding subscriptions are cancelled when contractWrappers.setProvider called', (done: DoneCallback) => { + it('Outstanding subscriptions are cancelled when contractWrappers.unsubscribeAll called', (done: DoneCallback) => { (async () => { const callbackNeverToBeCalled = callbackErrorReporter.reportNodeCallbackErrors(done)( (_logEvent: DecodedLogEvent<ERC20TokenApprovalEventArgs>) => { @@ -547,7 +547,7 @@ describe('ERC20Wrapper', () => { callbackNeverToBeCalled, ); const callbackToBeCalled = callbackErrorReporter.reportNodeCallbackErrors(done)(); - contractWrappers.setProvider(provider); + contractWrappers.unsubscribeAll(); contractWrappers.erc20Token.subscribe( tokenAddress, ERC20TokenEvents.Transfer, diff --git a/packages/contract-wrappers/test/erc721_wrapper_test.ts b/packages/contract-wrappers/test/erc721_wrapper_test.ts index 0b4d7c468..c57370b7b 100644 --- a/packages/contract-wrappers/test/erc721_wrapper_test.ts +++ b/packages/contract-wrappers/test/erc721_wrapper_test.ts @@ -326,7 +326,7 @@ describe('ERC721Wrapper', () => { ); })().catch(done); }); - it('Outstanding subscriptions are cancelled when contractWrappers.setProvider called', (done: DoneCallback) => { + it('Outstanding subscriptions are cancelled when contractWrappers.unsubscribeAll called', (done: DoneCallback) => { (async () => { const callbackNeverToBeCalled = callbackErrorReporter.reportNodeCallbackErrors(done)( (logEvent: DecodedLogEvent<ERC721TokenApprovalEventArgs>) => { @@ -340,7 +340,7 @@ describe('ERC721Wrapper', () => { callbackNeverToBeCalled, ); const callbackToBeCalled = callbackErrorReporter.reportNodeCallbackErrors(done)(); - contractWrappers.setProvider(provider); + contractWrappers.unsubscribeAll(); contractWrappers.erc721Token.subscribe( tokenAddress, ERC721TokenEvents.Approval, diff --git a/packages/contract-wrappers/test/ether_token_wrapper_test.ts b/packages/contract-wrappers/test/ether_token_wrapper_test.ts index 1fb6d2d42..74d030e1d 100644 --- a/packages/contract-wrappers/test/ether_token_wrapper_test.ts +++ b/packages/contract-wrappers/test/ether_token_wrapper_test.ts @@ -283,7 +283,7 @@ describe('EtherTokenWrapper', () => { await contractWrappers.etherToken.withdrawAsync(etherTokenAddress, withdrawalAmount, addressWithETH); })().catch(done); }); - it('should cancel outstanding subscriptions when ZeroEx.setProvider is called', (done: DoneCallback) => { + it('should cancel outstanding subscriptions when contractWrappers.unsubscribeAll is called', (done: DoneCallback) => { (async () => { const callbackNeverToBeCalled = callbackErrorReporter.reportNodeCallbackErrors(done)( (_logEvent: DecodedLogEvent<WETH9ApprovalEventArgs>) => { @@ -297,7 +297,7 @@ describe('EtherTokenWrapper', () => { callbackNeverToBeCalled, ); const callbackToBeCalled = callbackErrorReporter.reportNodeCallbackErrors(done)(); - contractWrappers.setProvider(provider); + contractWrappers.unsubscribeAll(); await contractWrappers.etherToken.depositAsync(etherTokenAddress, transferAmount, addressWithETH); contractWrappers.etherToken.subscribe( etherTokenAddress, diff --git a/packages/contract-wrappers/test/exchange_wrapper_test.ts b/packages/contract-wrappers/test/exchange_wrapper_test.ts index 7e29c76a1..4d0176349 100644 --- a/packages/contract-wrappers/test/exchange_wrapper_test.ts +++ b/packages/contract-wrappers/test/exchange_wrapper_test.ts @@ -410,7 +410,7 @@ describe('ExchangeWrapper', () => { await contractWrappers.exchange.cancelOrderAsync(signedOrder); })().catch(done); }); - it('Outstanding subscriptions are cancelled when contractWrappers.setProvider called', (done: DoneCallback) => { + it('Outstanding subscriptions are cancelled when contractWrappers.unsubscribeAll called', (done: DoneCallback) => { (async () => { const callbackNeverToBeCalled = callbackErrorReporter.reportNodeCallbackErrors(done)( (logEvent: DecodedLogEvent<ExchangeFillEventArgs>) => { @@ -419,7 +419,7 @@ describe('ExchangeWrapper', () => { ); contractWrappers.exchange.subscribe(ExchangeEvents.Fill, indexFilterValues, callbackNeverToBeCalled); - contractWrappers.setProvider(provider); + contractWrappers.unsubscribeAll(); const callback = callbackErrorReporter.reportNodeCallbackErrors(done)( (logEvent: DecodedLogEvent<ExchangeFillEventArgs>) => { |