diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-02-24 03:35:44 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-02-28 04:05:23 +0800 |
commit | 2d561bc8a05e8d1fca91cde93bae2080d87be926 (patch) | |
tree | 10d785eff73c67ecae09a337ed3721ff6b6102a9 /packages/0x.js/src/contract_wrappers/exchange_wrapper.ts | |
parent | f5275d3ad75d2a989556de99cdef82bcf2cd687c (diff) | |
download | dexon-0x-contracts-2d561bc8a05e8d1fca91cde93bae2080d87be926.tar dexon-0x-contracts-2d561bc8a05e8d1fca91cde93bae2080d87be926.tar.gz dexon-0x-contracts-2d561bc8a05e8d1fca91cde93bae2080d87be926.tar.bz2 dexon-0x-contracts-2d561bc8a05e8d1fca91cde93bae2080d87be926.tar.lz dexon-0x-contracts-2d561bc8a05e8d1fca91cde93bae2080d87be926.tar.xz dexon-0x-contracts-2d561bc8a05e8d1fca91cde93bae2080d87be926.tar.zst dexon-0x-contracts-2d561bc8a05e8d1fca91cde93bae2080d87be926.zip |
Allow users to specify the contracts backend in abi-gen
Diffstat (limited to 'packages/0x.js/src/contract_wrappers/exchange_wrapper.ts')
-rw-r--r-- | packages/0x.js/src/contract_wrappers/exchange_wrapper.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts b/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts index 6bafc84c1..e0f6bd539 100644 --- a/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts +++ b/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts @@ -858,7 +858,7 @@ export class ExchangeWrapper extends ContractWrapper { }); if (!_.isUndefined(errLog)) { const logArgs = (errLog as LogWithDecodedArgs<LogErrorContractEventArgs>).args; - const errCode = logArgs.errorId.toNumber(); + const errCode = logArgs.errorId; const errMessage = this._exchangeContractErrCodesToMsg[errCode]; throw new Error(errMessage); } @@ -906,11 +906,11 @@ export class ExchangeWrapper extends ContractWrapper { if (!_.isUndefined(this._exchangeContractIfExists)) { return this._exchangeContractIfExists; } - const web3ContractInstance = await this._instantiateContractIfExistsAsync( + const [abi, address] = await this._getContractAbiAndAddressFromArtifactsAsync( artifacts.ExchangeArtifact, this._contractAddressIfExists, ); - const contractInstance = new ExchangeContract(web3ContractInstance, this._web3Wrapper.getContractDefaults()); + const contractInstance = new ExchangeContract(this._web3Wrapper, abi, address); this._exchangeContractIfExists = contractInstance; return this._exchangeContractIfExists; } |