How to use the @0x/dev-utils.devConstants.TESTRPC_FIRST_ADDRESS 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 / coverage.ts View on Github external
_getCoverageSubprovider(): CoverageSubprovider {
        const defaultFromAddress = devConstants.TESTRPC_FIRST_ADDRESS;
        const solCompilerArtifactAdapter = new SolCompilerArtifactAdapter();
        const isVerbose = true;
        const subprovider = new CoverageSubprovider(solCompilerArtifactAdapter, defaultFromAddress, isVerbose);
        return subprovider;
    },
};
github 0xProject / 0x-monorepo / packages / migrations / src / migrate_with_test_defaults.ts View on Github external
export async function migrateOnceAsync(): Promise {
    const txDefaults = {
        gas: devConstants.GAS_LIMIT,
        from: devConstants.TESTRPC_FIRST_ADDRESS,
    };
    const provider: Web3ProviderEngine = web3Factory.getRpcProvider({ shouldUseInProcessGanache: true });
    return runMigrationsOnceAsync(provider, txDefaults);
}
github 0xProject / 0x-monorepo / contracts / test-utils / src / web3_wrapper.ts View on Github external
import { devConstants, env, EnvVars, Web3Config, web3Factory } from '@0x/dev-utils';
import { prependSubprovider, Web3ProviderEngine } from '@0x/subproviders';
import { logUtils } from '@0x/utils';
import { Web3Wrapper } from '@0x/web3-wrapper';
import * as _ from 'lodash';

import { constants } from './constants';
import { coverage } from './coverage';
import { profiler } from './profiler';
import { revertTrace } from './revert_trace';

export const txDefaults = {
    from: devConstants.TESTRPC_FIRST_ADDRESS,
    gas: devConstants.GAS_LIMIT,
    gasPrice: constants.DEFAULT_GAS_PRICE,
};

let providerConfigs: Web3Config = {
    total_accounts: constants.NUM_TEST_ACCOUNTS,
    shouldUseInProcessGanache: true,
    shouldAllowUnlimitedContractSize: true,
};

if (process.env.FORK_RPC_URL !== undefined) {
    providerConfigs = {
        ...providerConfigs,
        fork: process.env.FORK_RPC_URL,
        blockTime: 0,
        unlocked_accounts: [
github 0xProject / 0x-monorepo / contracts / test-utils / src / revert_trace.ts View on Github external
_getRevertTraceSubprovider(): RevertTraceSubprovider {
        const defaultFromAddress = devConstants.TESTRPC_FIRST_ADDRESS;
        const solCompilerArtifactAdapter = new SolCompilerArtifactAdapter();
        const isVerbose = true;
        const subprovider = new RevertTraceSubprovider(solCompilerArtifactAdapter, defaultFromAddress, isVerbose);
        return subprovider;
    },
};
github 0xProject / 0x-monorepo / contracts / test-utils / src / profiler.ts View on Github external
_getProfilerSubprovider(): ProfilerSubprovider {
        const defaultFromAddress = devConstants.TESTRPC_FIRST_ADDRESS;
        const solCompilerArtifactAdapter = new SolCompilerArtifactAdapter();
        const isVerbose = true;
        const subprovider = new ProfilerSubprovider(solCompilerArtifactAdapter, defaultFromAddress, isVerbose);
        return subprovider;
    },
};
github 0xProject / 0x-monorepo / packages / migrations / src / migrate_snapshot.ts View on Github external
(async () => {
    let providerConfigs;
    let provider: Web3ProviderEngine;
    let txDefaults;
    const packageJsonPath = path.join(__dirname, '../..', 'package.json');
    const packageJsonString = fs.readFileSync(packageJsonPath, 'utf8');
    const packageJson = JSON.parse(packageJsonString);
    if (packageJson.config === undefined || packageJson.config.snapshot_name === undefined) {
        throw new Error(`Did not find 'snapshot_name' key in package.json config`);
    }

    providerConfigs = { shouldUseInProcessGanache: true, ganacheDatabasePath: packageJson.config.snapshot_name };
    provider = web3Factory.getRpcProvider(providerConfigs);
    txDefaults = {
        from: devConstants.TESTRPC_FIRST_ADDRESS,
    };
    await runMigrationsAsync(provider, txDefaults);
    process.exit(0);
})().catch(err => {
    logUtils.log(err);
github 0xProject / 0x-monorepo / packages / migrations / src / migrate.ts View on Github external
(async () => {
    let providerConfigs;
    let provider: Web3ProviderEngine;
    let txDefaults;

    providerConfigs = { shouldUseInProcessGanache: false };
    provider = web3Factory.getRpcProvider(providerConfigs);
    txDefaults = {
        from: devConstants.TESTRPC_FIRST_ADDRESS,
    };
    await runMigrationsAsync(provider, txDefaults);
    process.exit(0);
})().catch(err => {
    logUtils.log(err);