Rename _unsubscribeAll to unsubscribeAll

This commit is contained in:
Leonid Logvinov
2018-02-26 14:35:15 -08:00
parent 709fa9e02e
commit 7f8f4df0a0
9 changed files with 13 additions and 12 deletions

View File

@@ -2,6 +2,7 @@
## v0.33.0 - _TBD, 2018_
* Rename all public `_unsubscribeAll` methods to `unsubscribeAll` (#415)
* Improve validation to force passing contract addresses on private networks (#385)
## v0.32.2 - _February 9, 2018_

View File

@@ -151,7 +151,7 @@ export class EtherTokenWrapper extends ContractWrapper {
/**
* Cancels all existing subscriptions
*/
public _unsubscribeAll(): void {
public unsubscribeAll(): void {
super._unsubscribeAll();
}
/**
@@ -168,7 +168,7 @@ export class EtherTokenWrapper extends ContractWrapper {
return contractAddressIfExists;
}
private _invalidateContractInstance(): void {
this._unsubscribeAll();
this.unsubscribeAll();
this._etherTokenContractsByAddress = {};
}
private async _getEtherTokenContractAsync(etherTokenAddress: string): Promise<EtherTokenContract> {

View File

@@ -679,7 +679,7 @@ export class ExchangeWrapper extends ContractWrapper {
/**
* Cancels all existing subscriptions
*/
public _unsubscribeAll(): void {
public unsubscribeAll(): void {
super._unsubscribeAll();
}
/**
@@ -862,7 +862,7 @@ export class ExchangeWrapper extends ContractWrapper {
return contractAddress;
}
private _invalidateContractInstances(): void {
this._unsubscribeAll();
this.unsubscribeAll();
delete this._exchangeContractIfExists;
}
private async _isValidSignatureUsingContractCallAsync(

View File

@@ -333,7 +333,7 @@ export class TokenWrapper extends ContractWrapper {
/**
* Cancels all existing subscriptions
*/
public _unsubscribeAll(): void {
public unsubscribeAll(): void {
super._unsubscribeAll();
}
/**
@@ -365,7 +365,7 @@ export class TokenWrapper extends ContractWrapper {
return logs;
}
private _invalidateContractInstances(): void {
this._unsubscribeAll();
this.unsubscribeAll();
this._tokenContractsByAddress = {};
}
private async _getTokenContractAsync(tokenAddress: string): Promise<TokenContract> {

View File

@@ -158,7 +158,7 @@ describe('EtherTokenWrapper', () => {
etherTokenAddress = etherToken.address;
});
afterEach(() => {
zeroEx.etherToken._unsubscribeAll();
zeroEx.etherToken.unsubscribeAll();
});
// Hack: Mocha does not allow a test to be both async and have a `done` callback
// Since we need to await the receipt of the event in the `subscribe` callback,

View File

@@ -922,7 +922,7 @@ describe('ExchangeWrapper', () => {
);
});
afterEach(async () => {
zeroEx.exchange._unsubscribeAll();
zeroEx.exchange.unsubscribeAll();
});
// Hack: Mocha does not allow a test to be both async and have a `done` callback
// Since we need to await the receipt of the event in the `subscribe` callback,

View File

@@ -49,7 +49,7 @@ describe('SubscriptionTest', () => {
tokenAddress = token.address;
});
afterEach(() => {
zeroEx.token._unsubscribeAll();
zeroEx.token.unsubscribeAll();
_.each(stubs, s => s.restore());
stubs = [];
});
@@ -76,7 +76,7 @@ describe('SubscriptionTest', () => {
const callback = (err: Error | null, logEvent?: DecodedLogEvent<ApprovalContractEventArgs>) => _.noop;
zeroEx.token.subscribe(tokenAddress, TokenEvents.Approval, indexFilterValues, callback);
stubs = [Sinon.stub((zeroEx as any)._web3Wrapper, 'getBlockAsync').throws(new Error('JSON RPC error'))];
zeroEx.token._unsubscribeAll();
zeroEx.token.unsubscribeAll();
done();
})().catch(done);
});

View File

@@ -377,7 +377,7 @@ describe('TokenWrapper', () => {
tokenAddress = token.address;
});
afterEach(() => {
zeroEx.token._unsubscribeAll();
zeroEx.token.unsubscribeAll();
});
// Hack: Mocha does not allow a test to be both async and have a `done` callback
// Since we need to await the receipt of the event in the `subscribe` callback,