From 6f8e98e53727a1efc08800017cf2bde38884c982 Mon Sep 17 00:00:00 2001 From: Alex Browne Date: Mon, 15 Oct 2018 17:35:25 -0700 Subject: In contract-wrappers, remove setProvider and add unsubscribeAll method. --- packages/contract-wrappers/test/erc20_wrapper_test.ts | 4 ++-- packages/contract-wrappers/test/erc721_wrapper_test.ts | 4 ++-- packages/contract-wrappers/test/ether_token_wrapper_test.ts | 4 ++-- packages/contract-wrappers/test/exchange_wrapper_test.ts | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'packages/contract-wrappers/test') 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) => { @@ -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) => { @@ -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) => { @@ -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) => { @@ -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) => { -- cgit v1.2.3