How to use the @0x/dev-utils.EnvVars.SolidityCoverage function in @0x/dev-utils

To help you get started, we’ve selected a few @0x/dev-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github 0xProject / 0x-monorepo / contracts / test-utils / src / web3_wrapper.ts View on Github external
fork: process.env.FORK_RPC_URL,
        blockTime: 0,
        unlocked_accounts: [
            // ZeroExGovernor signer addresses
            '0x257619b7155d247e43c8b6d90c8c17278ae481f0',
            '0x5ee2a00f8f01d099451844af7f894f26a57fcbf2',
            '0x894d623e0e0e8ed12c4a73dada999e275684a37d',
            // ERC20BridgeProxy
            '0x8ed95d1746bf1e4dab58d8ed4724f1ef95b20db0',
        ],
    };
}

export const provider: Web3ProviderEngine = web3Factory.getRpcProvider(providerConfigs);
provider.stop();
const isCoverageEnabled = env.parseBoolean(EnvVars.SolidityCoverage);
const isProfilerEnabled = env.parseBoolean(EnvVars.SolidityProfiler);
const isRevertTraceEnabled = env.parseBoolean(EnvVars.SolidityRevertTrace);
const enabledSubproviderCount = _.filter(
    [isCoverageEnabled, isProfilerEnabled, isRevertTraceEnabled],
    _.identity.bind(_),
).length;
if (enabledSubproviderCount > 1) {
    throw new Error(`Only one of coverage, profiler, or revert trace subproviders can be enabled at a time`);
}
if (isCoverageEnabled) {
    const coverageSubprovider = coverage.getCoverageSubproviderSingleton();
    prependSubprovider(provider, coverageSubprovider);
}
if (isProfilerEnabled) {
    const profilerSubprovider = profiler.getProfilerSubproviderSingleton();
    logUtils.log(