Address review comments and regenerate contract-wrappers

This commit is contained in:
Lawrence Forman
2020-02-07 23:03:16 -05:00
parent 1a9ed4d4fe
commit 8635849977
17 changed files with 1458 additions and 127 deletions

View File

@@ -130,12 +130,9 @@ export class {{contractName}}Contract extends BaseContract {
txDefaults
);
const bytecode = linkLibrariesInBytecode(
artifact.compilerOutput.evm.bytecode,
artifact,
libraryAddresses,
);
if (!hexUtils.isHex(bytecode)) {
throw new Error(`Bytecode for "${artifact.contractName}" was not fully linked.`);
}
return {{contractName}}Contract.deployAsync(bytecode, abi, provider, txDefaults, logDecodeDependenciesAbiOnly, {{> params inputs=ctor.inputs}});
}
@@ -236,12 +233,9 @@ export class {{contractName}}Contract extends BaseContract {
);
// Deploy this library.
const linkedLibraryBytecode = linkLibrariesInBytecode(
libraryArtifact.compilerOutput.evm.bytecode,
libraryArtifact,
libraryAddresses,
);
if (!hexUtils.isHex(linkedLibraryBytecode)) {
throw new Error(`Bytecode for library "${libraryArtifact.contractName}" was not fully linked.`);
}
const txDataWithDefaults = await BaseContract._applyDefaultsToContractTxDataAsync(
{
data: linkedLibraryBytecode,

View File

@@ -119,10 +119,7 @@ export class AbiGenDummyContract extends BaseContract {
new Web3Wrapper(provider),
txDefaults,
);
const bytecode = linkLibrariesInBytecode(artifact.compilerOutput.evm.bytecode, libraryAddresses);
if (!hexUtils.isHex(bytecode)) {
throw new Error(`Bytecode for "${artifact.contractName}" was not fully linked.`);
}
const bytecode = linkLibrariesInBytecode(artifact, libraryAddresses);
return AbiGenDummyContract.deployAsync(bytecode, abi, provider, txDefaults, logDecodeDependenciesAbiOnly);
}
@@ -933,13 +930,7 @@ export class AbiGenDummyContract extends BaseContract {
libraryAddresses,
);
// Deploy this library.
const linkedLibraryBytecode = linkLibrariesInBytecode(
libraryArtifact.compilerOutput.evm.bytecode,
libraryAddresses,
);
if (!hexUtils.isHex(linkedLibraryBytecode)) {
throw new Error(`Bytecode for library "${libraryArtifact.contractName}" was not fully linked.`);
}
const linkedLibraryBytecode = linkLibrariesInBytecode(libraryArtifact, libraryAddresses);
const txDataWithDefaults = await BaseContract._applyDefaultsToContractTxDataAsync(
{
data: linkedLibraryBytecode,

View File

@@ -98,10 +98,7 @@ export class LibDummyContract extends BaseContract {
new Web3Wrapper(provider),
txDefaults,
);
const bytecode = linkLibrariesInBytecode(artifact.compilerOutput.evm.bytecode, libraryAddresses);
if (!hexUtils.isHex(bytecode)) {
throw new Error(`Bytecode for "${artifact.contractName}" was not fully linked.`);
}
const bytecode = linkLibrariesInBytecode(artifact, libraryAddresses);
return LibDummyContract.deployAsync(bytecode, abi, provider, txDefaults, logDecodeDependenciesAbiOnly);
}
@@ -180,13 +177,7 @@ export class LibDummyContract extends BaseContract {
libraryAddresses,
);
// Deploy this library.
const linkedLibraryBytecode = linkLibrariesInBytecode(
libraryArtifact.compilerOutput.evm.bytecode,
libraryAddresses,
);
if (!hexUtils.isHex(linkedLibraryBytecode)) {
throw new Error(`Bytecode for library "${libraryArtifact.contractName}" was not fully linked.`);
}
const linkedLibraryBytecode = linkLibrariesInBytecode(libraryArtifact, libraryAddresses);
const txDataWithDefaults = await BaseContract._applyDefaultsToContractTxDataAsync(
{
data: linkedLibraryBytecode,

View File

@@ -99,10 +99,7 @@ export class TestLibDummyContract extends BaseContract {
new Web3Wrapper(provider),
txDefaults,
);
const bytecode = linkLibrariesInBytecode(artifact.compilerOutput.evm.bytecode, libraryAddresses);
if (!hexUtils.isHex(bytecode)) {
throw new Error(`Bytecode for "${artifact.contractName}" was not fully linked.`);
}
const bytecode = linkLibrariesInBytecode(artifact, libraryAddresses);
return TestLibDummyContract.deployAsync(bytecode, abi, provider, txDefaults, logDecodeDependenciesAbiOnly);
}
@@ -220,13 +217,7 @@ export class TestLibDummyContract extends BaseContract {
libraryAddresses,
);
// Deploy this library.
const linkedLibraryBytecode = linkLibrariesInBytecode(
libraryArtifact.compilerOutput.evm.bytecode,
libraryAddresses,
);
if (!hexUtils.isHex(linkedLibraryBytecode)) {
throw new Error(`Bytecode for library "${libraryArtifact.contractName}" was not fully linked.`);
}
const linkedLibraryBytecode = linkLibrariesInBytecode(libraryArtifact, libraryAddresses);
const txDataWithDefaults = await BaseContract._applyDefaultsToContractTxDataAsync(
{
data: linkedLibraryBytecode,