diff options
author | Jacob Evans <dekz@dekz.net> | 2018-11-26 18:23:19 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-26 18:23:19 +0800 |
commit | dc965da64eb8549a34bd1d67a5559c848083373d (patch) | |
tree | a34b0e80c4b6c73a2e4e9db641a4c6027a0b7362 /packages/abi-gen-wrappers | |
parent | 1d83d99d87385c396a57bfdf48a8a0211ace557b (diff) | |
parent | 09a683557bdf8633e1e0ff85ebf8c8789f391c27 (diff) | |
download | dexon-sol-tools-dc965da64eb8549a34bd1d67a5559c848083373d.tar dexon-sol-tools-dc965da64eb8549a34bd1d67a5559c848083373d.tar.gz dexon-sol-tools-dc965da64eb8549a34bd1d67a5559c848083373d.tar.bz2 dexon-sol-tools-dc965da64eb8549a34bd1d67a5559c848083373d.tar.lz dexon-sol-tools-dc965da64eb8549a34bd1d67a5559c848083373d.tar.xz dexon-sol-tools-dc965da64eb8549a34bd1d67a5559c848083373d.tar.zst dexon-sol-tools-dc965da64eb8549a34bd1d67a5559c848083373d.zip |
Merge pull request #1309 from 0xProject/bug/contract-artifacts/testnet-exchange
[contract-artifacts] Use Testnet Exchange artifact
Diffstat (limited to 'packages/abi-gen-wrappers')
-rw-r--r-- | packages/abi-gen-wrappers/CHANGELOG.json | 9 | ||||
-rw-r--r-- | packages/abi-gen-wrappers/src/generated-wrappers/exchange.ts | 17 |
2 files changed, 21 insertions, 5 deletions
diff --git a/packages/abi-gen-wrappers/CHANGELOG.json b/packages/abi-gen-wrappers/CHANGELOG.json index 955b8220f..f74d98afa 100644 --- a/packages/abi-gen-wrappers/CHANGELOG.json +++ b/packages/abi-gen-wrappers/CHANGELOG.json @@ -1,5 +1,14 @@ [ { + "version": "2.0.0", + "changes": [ + { + "pr": 1309, + "note": "Update Exchange artifact to receive ZRX asset data as a constructor argument" + } + ] + }, + { "version": "1.1.0", "changes": [ { diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/exchange.ts b/packages/abi-gen-wrappers/src/generated-wrappers/exchange.ts index a04b6025e..11b5e7024 100644 --- a/packages/abi-gen-wrappers/src/generated-wrappers/exchange.ts +++ b/packages/abi-gen-wrappers/src/generated-wrappers/exchange.ts @@ -3028,29 +3028,35 @@ export class ExchangeContract extends BaseContract { artifact: ContractArtifact | SimpleContractArtifact, provider: Provider, txDefaults: Partial<TxData>, + _zrxAssetData: string, ): Promise<ExchangeContract> { if (_.isUndefined(artifact.compilerOutput)) { throw new Error('Compiler output not found in the artifact file'); } const bytecode = artifact.compilerOutput.evm.bytecode.object; const abi = artifact.compilerOutput.abi; - return ExchangeContract.deployAsync(bytecode, abi, provider, txDefaults, ); + return ExchangeContract.deployAsync(bytecode, abi, provider, txDefaults, _zrxAssetData +); } public static async deployAsync( bytecode: string, abi: ContractAbi, provider: Provider, txDefaults: Partial<TxData>, + _zrxAssetData: string, ): Promise<ExchangeContract> { const constructorAbi = BaseContract._lookupConstructorAbi(abi); - [] = BaseContract._formatABIDataItemList( + [_zrxAssetData +] = BaseContract._formatABIDataItemList( constructorAbi.inputs, - [], + [_zrxAssetData +], BaseContract._bigNumberToString, ); const iface = new ethers.utils.Interface(abi); const deployInfo = iface.deployFunction; - const txData = deployInfo.encode(bytecode, []); + const txData = deployInfo.encode(bytecode, [_zrxAssetData +]); const web3Wrapper = new Web3Wrapper(provider); const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync( {data: txData}, @@ -3062,7 +3068,8 @@ export class ExchangeContract extends BaseContract { const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash); logUtils.log(`Exchange successfully deployed at ${txReceipt.contractAddress}`); const contractInstance = new ExchangeContract(abi, txReceipt.contractAddress as string, provider, txDefaults); - contractInstance.constructorArgs = []; + contractInstance.constructorArgs = [_zrxAssetData +]; return contractInstance; } constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) { |