Use hardcoded deployedBytecode for local EVM execution (#2198)

* hardcode deployedBytecode in contracts

* log warning if bytecode is empty or invalid

* be typesafe
This commit is contained in:
Xianny
2019-09-26 08:38:29 -07:00
committed by GitHub
parent 97eabc6c03
commit cb20f03a92
31 changed files with 275 additions and 21 deletions

View File

@@ -28,6 +28,7 @@ import * as ethers from 'ethers';
// tslint:disable:no-parameter-reassignment
// tslint:disable-next-line:class-name
export class CoordinatorContract extends BaseContract {
public static deployedBytecode: string | undefined;
/**
* Recovers the address of a signer given a hash and signature.
*/
@@ -1491,8 +1492,17 @@ export class CoordinatorContract extends BaseContract {
supportedProvider: SupportedProvider,
txDefaults?: Partial<TxData>,
logDecodeDependencies?: { [contractName: string]: ContractAbi },
deployedBytecode: string | undefined = CoordinatorContract.deployedBytecode,
) {
super('Coordinator', CoordinatorContract.ABI(), address, supportedProvider, txDefaults, logDecodeDependencies);
super(
'Coordinator',
CoordinatorContract.ABI(),
address,
supportedProvider,
txDefaults,
logDecodeDependencies,
deployedBytecode,
);
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
}
}