aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-07-05 02:22:12 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-07-05 02:22:12 +0800
commit33216ea53f8c12fb229c5baab83d92464c67b296 (patch)
treeacc0fae440db20b494e14613b2e7e8e86f91cd1f
parent4ebf046cea8ff510567b5d05d188cd9f84ad1988 (diff)
downloaddexon-0x-contracts-33216ea53f8c12fb229c5baab83d92464c67b296.tar.gz
dexon-0x-contracts-33216ea53f8c12fb229c5baab83d92464c67b296.tar.zst
dexon-0x-contracts-33216ea53f8c12fb229c5baab83d92464c67b296.zip
Make this.proxy.invalidateContractInstance and this.tokenRegistry.invalidateContractInstance private
-rw-r--r--src/0x.ts4
-rw-r--r--src/contract_wrappers/proxy_wrapper.ts6
-rw-r--r--src/contract_wrappers/token_registry_wrapper.ts6
3 files changed, 8 insertions, 8 deletions
diff --git a/src/0x.ts b/src/0x.ts
index 25ad538b9..5938d558a 100644
--- a/src/0x.ts
+++ b/src/0x.ts
@@ -169,9 +169,9 @@ export class ZeroEx {
public async setProviderAsync(provider: Web3Provider) {
this._web3Wrapper.setProvider(provider);
await (this.exchange as any)._invalidateContractInstancesAsync();
- this.tokenRegistry.invalidateContractInstance();
+ (this.tokenRegistry as any)._invalidateContractInstance();
await (this.token as any)._invalidateContractInstancesAsync();
- this.proxy.invalidateContractInstance();
+ (this.proxy as any)._invalidateContractInstance();
}
/**
* Get user Ethereum addresses available through the supplied web3 instance available for sending transactions.
diff --git a/src/contract_wrappers/proxy_wrapper.ts b/src/contract_wrappers/proxy_wrapper.ts
index bdf163f35..05d4e142c 100644
--- a/src/contract_wrappers/proxy_wrapper.ts
+++ b/src/contract_wrappers/proxy_wrapper.ts
@@ -9,9 +9,6 @@ import {ProxyContract} from '../types';
*/
export class ProxyWrapper extends ContractWrapper {
private _proxyContractIfExists?: ProxyContract;
- public invalidateContractInstance(): void {
- delete this._proxyContractIfExists;
- }
/**
* Check if the Exchange contract address is authorized by the Proxy contract.
* @param exchangeContractAddress The hex encoded address of the Exchange contract to call.
@@ -32,6 +29,9 @@ export class ProxyWrapper extends ContractWrapper {
const authorizedAddresses = await proxyContractInstance.getAuthorizedAddresses.call();
return authorizedAddresses;
}
+ private _invalidateContractInstance(): void {
+ delete this._proxyContractIfExists;
+ }
private async _getProxyContractAsync(): Promise<ProxyContract> {
if (!_.isUndefined(this._proxyContractIfExists)) {
return this._proxyContractIfExists;
diff --git a/src/contract_wrappers/token_registry_wrapper.ts b/src/contract_wrappers/token_registry_wrapper.ts
index 3e87e4852..c9f21e46f 100644
--- a/src/contract_wrappers/token_registry_wrapper.ts
+++ b/src/contract_wrappers/token_registry_wrapper.ts
@@ -13,9 +13,6 @@ export class TokenRegistryWrapper extends ContractWrapper {
constructor(web3Wrapper: Web3Wrapper) {
super(web3Wrapper);
}
- public invalidateContractInstance(): void {
- delete this._tokenRegistryContractIfExists;
- }
/**
* Retrieves all the tokens currently listed in the Token Registry smart contract
* @return An array of objects that conform to the Token interface.
@@ -40,6 +37,9 @@ export class TokenRegistryWrapper extends ContractWrapper {
});
return tokens;
}
+ private _invalidateContractInstance(): void {
+ delete this._tokenRegistryContractIfExists;
+ }
private async _getTokenRegistryContractAsync(): Promise<TokenRegistryContract> {
if (!_.isUndefined(this._tokenRegistryContractIfExists)) {
return this._tokenRegistryContractIfExists;