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. --- .../contract-wrappers/src/contract_wrappers/erc20_proxy_wrapper.ts | 6 ------ .../contract-wrappers/src/contract_wrappers/erc20_token_wrapper.ts | 7 ------- .../src/contract_wrappers/erc721_proxy_wrapper.ts | 6 ------ .../src/contract_wrappers/erc721_token_wrapper.ts | 7 ------- .../contract-wrappers/src/contract_wrappers/ether_token_wrapper.ts | 5 ----- .../contract-wrappers/src/contract_wrappers/exchange_wrapper.ts | 5 ----- .../contract-wrappers/src/contract_wrappers/forwarder_wrapper.ts | 6 ------ .../src/contract_wrappers/order_validator_wrapper.ts | 6 ------ 8 files changed, 48 deletions(-) (limited to 'packages/contract-wrappers/src/contract_wrappers') diff --git a/packages/contract-wrappers/src/contract_wrappers/erc20_proxy_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/erc20_proxy_wrapper.ts index 369e27e19..e59b2c20b 100644 --- a/packages/contract-wrappers/src/contract_wrappers/erc20_proxy_wrapper.ts +++ b/packages/contract-wrappers/src/contract_wrappers/erc20_proxy_wrapper.ts @@ -58,12 +58,6 @@ export class ERC20ProxyWrapper extends ContractWrapper { const authorizedAddresses = await ERC20ProxyContractInstance.getAuthorizedAddresses.callAsync(); return authorizedAddresses; } - // HACK: We don't want this method to be visible to the other units within that package but not to the end user. - // TS doesn't give that possibility and therefore we make it private and access it over an any cast. Because of that tslint sees it as unused. - // tslint:disable-next-line:no-unused-variable - private _invalidateContractInstance(): void { - delete this._erc20ProxyContractIfExists; - } private _getERC20ProxyContract(): ERC20ProxyContract { if (!_.isUndefined(this._erc20ProxyContractIfExists)) { return this._erc20ProxyContractIfExists; diff --git a/packages/contract-wrappers/src/contract_wrappers/erc20_token_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/erc20_token_wrapper.ts index 2db0165bc..97043bd19 100644 --- a/packages/contract-wrappers/src/contract_wrappers/erc20_token_wrapper.ts +++ b/packages/contract-wrappers/src/contract_wrappers/erc20_token_wrapper.ts @@ -422,13 +422,6 @@ export class ERC20TokenWrapper extends ContractWrapper { ); return logs; } - // HACK: We don't want this method to be visible to the other units within that package but not to the end user. - // TS doesn't give that possibility and therefore we make it private and access it over an any cast. Because of that tslint sees it as unused. - // tslint:disable-next-line:no-unused-variable - private _invalidateContractInstances(): void { - this.unsubscribeAll(); - this._tokenContractsByAddress = {}; - } private async _getTokenContractAsync(tokenAddress: string): Promise { const normalizedTokenAddress = tokenAddress.toLowerCase(); let tokenContract = this._tokenContractsByAddress[normalizedTokenAddress]; diff --git a/packages/contract-wrappers/src/contract_wrappers/erc721_proxy_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/erc721_proxy_wrapper.ts index 0c61d939f..adee3e3ab 100644 --- a/packages/contract-wrappers/src/contract_wrappers/erc721_proxy_wrapper.ts +++ b/packages/contract-wrappers/src/contract_wrappers/erc721_proxy_wrapper.ts @@ -58,12 +58,6 @@ export class ERC721ProxyWrapper extends ContractWrapper { const authorizedAddresses = await ERC721ProxyContractInstance.getAuthorizedAddresses.callAsync(); return authorizedAddresses; } - // HACK: We don't want this method to be visible to the other units within that package but not to the end user. - // TS doesn't give that possibility and therefore we make it private and access it over an any cast. Because of that tslint sees it as unused. - // tslint:disable-next-line:no-unused-variable - private _invalidateContractInstance(): void { - delete this._erc721ProxyContractIfExists; - } private _getERC721ProxyContract(): ERC721ProxyContract { if (!_.isUndefined(this._erc721ProxyContractIfExists)) { return this._erc721ProxyContractIfExists; diff --git a/packages/contract-wrappers/src/contract_wrappers/erc721_token_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/erc721_token_wrapper.ts index b18692964..a59801b41 100644 --- a/packages/contract-wrappers/src/contract_wrappers/erc721_token_wrapper.ts +++ b/packages/contract-wrappers/src/contract_wrappers/erc721_token_wrapper.ts @@ -449,13 +449,6 @@ export class ERC721TokenWrapper extends ContractWrapper { ); return logs; } - // HACK: We don't want this method to be visible to the other units within that package but not to the end user. - // TS doesn't give that possibility and therefore we make it private and access it over an any cast. Because of that tslint sees it as unused. - // tslint:disable-next-line:no-unused-variable - private _invalidateContractInstances(): void { - this.unsubscribeAll(); - this._tokenContractsByAddress = {}; - } private async _getTokenContractAsync(tokenAddress: string): Promise { const normalizedTokenAddress = tokenAddress.toLowerCase(); let tokenContract = this._tokenContractsByAddress[normalizedTokenAddress]; diff --git a/packages/contract-wrappers/src/contract_wrappers/ether_token_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/ether_token_wrapper.ts index 2586401bc..8bb27369f 100644 --- a/packages/contract-wrappers/src/contract_wrappers/ether_token_wrapper.ts +++ b/packages/contract-wrappers/src/contract_wrappers/ether_token_wrapper.ts @@ -192,11 +192,6 @@ export class EtherTokenWrapper extends ContractWrapper { public unsubscribeAll(): void { super._unsubscribeAll(); } - // tslint:disable-next-line:no-unused-variable - private _invalidateContractInstance(): void { - this.unsubscribeAll(); - this._etherTokenContractsByAddress = {}; - } private async _getEtherTokenContractAsync(etherTokenAddress: string): Promise { let etherTokenContract = this._etherTokenContractsByAddress[etherTokenAddress]; if (!_.isUndefined(etherTokenContract)) { diff --git a/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts index a9809e0e7..9063e0e40 100644 --- a/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts +++ b/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts @@ -1180,11 +1180,6 @@ export class ExchangeWrapper extends ContractWrapper { const encoder = new TransactionEncoder(exchangeInstance); return encoder; } - // tslint:disable:no-unused-variable - private _invalidateContractInstances(): void { - this.unsubscribeAll(); - delete this._exchangeContractIfExists; - } // tslint:enable:no-unused-variable private async _getExchangeContractAsync(): Promise { if (!_.isUndefined(this._exchangeContractIfExists)) { diff --git a/packages/contract-wrappers/src/contract_wrappers/forwarder_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/forwarder_wrapper.ts index 93dcd6d66..b6fc071ea 100644 --- a/packages/contract-wrappers/src/contract_wrappers/forwarder_wrapper.ts +++ b/packages/contract-wrappers/src/contract_wrappers/forwarder_wrapper.ts @@ -234,12 +234,6 @@ export class ForwarderWrapper extends ContractWrapper { ); return txHash; } - // HACK: We don't want this method to be visible to the other units within that package but not to the end user. - // TS doesn't give that possibility and therefore we make it private and access it over an any cast. Because of that tslint sees it as unused. - // tslint:disable-next-line:no-unused-variable - private _invalidateContractInstance(): void { - delete this._forwarderContractIfExists; - } private async _getForwarderContractAsync(): Promise { if (!_.isUndefined(this._forwarderContractIfExists)) { return this._forwarderContractIfExists; diff --git a/packages/contract-wrappers/src/contract_wrappers/order_validator_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/order_validator_wrapper.ts index 4b6196eff..2ae1a158b 100644 --- a/packages/contract-wrappers/src/contract_wrappers/order_validator_wrapper.ts +++ b/packages/contract-wrappers/src/contract_wrappers/order_validator_wrapper.ts @@ -169,12 +169,6 @@ export class OrderValidatorWrapper extends ContractWrapper { const result = await OrderValidatorContractInstance.getERC721TokenOwner.callAsync(tokenAddress, tokenId); return result; } - // HACK: We don't want this method to be visible to the other units within that package but not to the end user. - // TS doesn't give that possibility and therefore we make it private and access it over an any cast. Because of that tslint sees it as unused. - // tslint:disable-next-line:no-unused-variable - private _invalidateContractInstance(): void { - delete this._orderValidatorContractIfExists; - } private async _getOrderValidatorContractAsync(): Promise { if (!_.isUndefined(this._orderValidatorContractIfExists)) { return this._orderValidatorContractIfExists; -- cgit