aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-07-05 02:48:41 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-07-05 02:48:41 +0800
commita45f6ff4af2f79911af6c64dff8b684651c05c72 (patch)
treeaa9a396389109b5b0b40f49a7bdb5f1b5f35a47d
parent74e991db94d777ecb4a566f03561fdabe8d55007 (diff)
downloaddexon-sol-tools-a45f6ff4af2f79911af6c64dff8b684651c05c72.tar
dexon-sol-tools-a45f6ff4af2f79911af6c64dff8b684651c05c72.tar.gz
dexon-sol-tools-a45f6ff4af2f79911af6c64dff8b684651c05c72.tar.bz2
dexon-sol-tools-a45f6ff4af2f79911af6c64dff8b684651c05c72.tar.lz
dexon-sol-tools-a45f6ff4af2f79911af6c64dff8b684651c05c72.tar.xz
dexon-sol-tools-a45f6ff4af2f79911af6c64dff8b684651c05c72.tar.zst
dexon-sol-tools-a45f6ff4af2f79911af6c64dff8b684651c05c72.zip
Fix the bug when didn't invalidate etherToken contract instance
-rw-r--r--CHANGELOG.md1
-rw-r--r--src/0x.ts1
-rw-r--r--src/contract_wrappers/ether_token_wrapper.ts3
3 files changed, 5 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 99bed1c19..e7a74e9ae 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,7 @@ v0.8.0 - TBD
* `zeroEx.exchange.invalidateContractInstancesAsync`
* `zeroEx.proxy.invalidateContractInstance`
* `zeroEx.tokenRegistry.invalidateContractInstance`
+ * Fix the bug when `zeroEx.setProviderAsync` didn't invalidate etherToken contract instance
v0.7.1 - _Jun. 26, 2017_
------------------------
diff --git a/src/0x.ts b/src/0x.ts
index 5938d558a..d790ca38e 100644
--- a/src/0x.ts
+++ b/src/0x.ts
@@ -172,6 +172,7 @@ export class ZeroEx {
(this.tokenRegistry as any)._invalidateContractInstance();
await (this.token as any)._invalidateContractInstancesAsync();
(this.proxy as any)._invalidateContractInstance();
+ (this.etherToken as any)._invalidateContractInstance();
}
/**
* Get user Ethereum addresses available through the supplied web3 instance available for sending transactions.
diff --git a/src/contract_wrappers/ether_token_wrapper.ts b/src/contract_wrappers/ether_token_wrapper.ts
index 76e7289b7..03d714bd7 100644
--- a/src/contract_wrappers/ether_token_wrapper.ts
+++ b/src/contract_wrappers/ether_token_wrapper.ts
@@ -64,6 +64,9 @@ export class EtherTokenWrapper extends ContractWrapper {
const wethContract = await this._getEtherTokenContractAsync();
return wethContract.address;
}
+ private _invalidateContractInstance(): void {
+ delete this._etherTokenContractIfExists;
+ }
private async _getEtherTokenContractAsync(): Promise<EtherTokenContract> {
if (!_.isUndefined(this._etherTokenContractIfExists)) {
return this._etherTokenContractIfExists;