@0x/dev-utils: Make ganache's allowUnlimitedCOntractSize option configurable via Web3Config.

`@0x/dev-utils`: Add `UnlimitedContractSize` to `EnvVars`.
This commit is contained in:
Lawrence Forman
2019-08-19 15:13:22 -04:00
parent edef3bc30e
commit 0c53e2fe46
3 changed files with 8 additions and 4 deletions

View File

@@ -7,7 +7,11 @@
"pr": 2031
},
{
"note": "Set `allowUnlimitedContractSize` option when creating a ganache provider",
"note": "Add `shouldAllowUnlimitedContractSize` to `Web3Config`.",
"pr": 2075
},
{
"note": "Add `UNLIMITED_CONTRACT_SIZE` to `EnvVars`.",
"pr": 2075
}
]

View File

@@ -6,6 +6,7 @@ export enum EnvVars {
SolidityProfiler = 'SOLIDITY_PROFILER',
SolidityRevertTrace = 'SOLIDITY_REVERT_TRACE',
VerboseGanache = 'VERBOSE_GANACHE',
UnlimitedContractSize = 'UNLIMITED_CONTRACT_SIZE',
}
export const env = {

View File

@@ -19,6 +19,7 @@ export interface Web3Config {
rpcUrl?: string; // default: localhost:8545
shouldUseFakeGasEstimate?: boolean; // default: true
ganacheDatabasePath?: string; // default: undefined, creates a tmp dir
shouldAllowUnlimitedContractSize?: boolean;
}
export const web3Factory = {
@@ -58,9 +59,7 @@ export const web3Factory = {
new GanacheSubprovider({
vmErrorsOnRPCResponse: shouldThrowErrorsOnGanacheRPCResponse,
db_path: config.ganacheDatabasePath,
// HACK(dorothy-zbornak): Mainnet gas limit is 8M, but ganache won't
// go beyond 7M, which means we can't deploy certain large contracts.
allowUnlimitedContractSize: true,
allowUnlimitedContractSize: config.shouldAllowUnlimitedContractSize,
gasLimit: constants.GAS_LIMIT,
logger,
verbose: env.parseBoolean(EnvVars.VerboseGanache),