Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
detect: async function(config) {
expect.options(config, ["networks"]);
helpers.setUpConfig(config);
helpers.validateNetworkConfig(config);
const interfaceAdapter = new InterfaceAdapter({
provider: config.provider,
networkType: config.networks[config.network].type
});
const web3 = new Web3Shim({
provider: config.provider,
networkType: config.networks[config.network].type
});
await Provider.testConnection(config);
await helpers.detectAndSetNetworkId(config, web3, interfaceAdapter);
await helpers.setFromOnConfig(config, web3, interfaceAdapter);
},
.then(async () => {
await Provider.testConnection(conf);
await Environment.detect(conf);
const {
dryRunOnly,
dryRunAndMigrations
} = command.determineDryRunSettings(conf, options);
if (dryRunOnly) {
conf.dryRun = true;
await setupDryRunEnvironmentThenRunMigrations(conf);
} else if (dryRunAndMigrations) {
const currentBuild = conf.contracts_build_directory;
conf.dryRun = true;
await setupDryRunEnvironmentThenRunMigrations(conf);