UNPKG

hardhat

Version:

Hardhat is an extensible developer tool that helps smart contract developers increase productivity by reliably bringing together the tools they want.

27 lines 1.08 kB
/** * Returns a copy of the resolved EDR network config with coverage-specific * overrides applied. When coverage is enabled and the user has not set the * field explicitly: * * - `allowUnlimitedContractSize` defaults to `true`, because coverage * instrumentation can push the contract size over the limit. * - `blockGasLimit` and `transactionGasCap` default to `false` (disabled), * so the added gas of coverage instrumentation does not push tests over * the per-block or EIP-7825 transaction caps. * * Explicit user values are preserved in all three cases. * * When coverage is disabled, the config is returned unchanged. */ export function applyCoverageNetworkOverrides(config, shouldEnableCoverage) { if (!shouldEnableCoverage) { return config; } return { ...config, allowUnlimitedContractSize: config.allowUnlimitedContractSize ?? true, blockGasLimit: config.blockGasLimit ?? false, transactionGasCap: config.transactionGasCap ?? false, }; } //# sourceMappingURL=apply-coverage-network-overrides.js.map