blob: 23bd62b938df25e1fcd99a808ec97fbc3d1c5b0b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
import { env, EnvVars } from '@0xproject/dev-utils';
import { GanacheSubprovider } from '@0xproject/subproviders';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as fs from 'fs';
import * as _ from 'lodash';
import ProviderEngine = require('web3-provider-engine');
import { config } from './config';
import { coverage } from './coverage';
export const web3Provider = new ProviderEngine();
const isCoverageEnabled = env.parseBoolean(EnvVars.SolidityCoverage);
if (isCoverageEnabled) {
web3Provider.addProvider(coverage.getCoverageSubproviderSingleton());
}
web3Provider.addProvider(
new GanacheSubprovider({
logger: {
log: (arg: any) => {
fs.appendFileSync(config.ganacheLogFile, `${arg}\n`);
},
},
verbose: env.parseBoolean(EnvVars.SolidityCoverage),
networkId: config.networkId,
mnemonic: config.mnemonic,
}),
);
web3Provider.start();
export const web3Wrapper = new Web3Wrapper(web3Provider);
|