Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"resolver",
"provider",
"contracts_build_directory"
]);
this.config = Config.default().merge(options);
this.logger = options.logger || console;
this.initial_resolver = options.resolver;
this.provider = options.provider;
this.can_snapshot = false;
this.first_snapshot = true;
this.initial_snapshot = null;
this.known_events = {};
this.interfaceAdapter = createInterfaceAdapter({
provider: options.provider,
networkType: options.networks[options.network].type
});
// For each test
this.currentTestStartBlock = null;
this.BEFORE_TIMEOUT =
(options.mocha && options.mocha.before_timeout) || 120000;
this.TEST_TIMEOUT = (options.mocha && options.mocha.timeout) || 300000;
}
prepareForMigrations(options) {
const logger = options.logger;
const interfaceAdapter = createInterfaceAdapter({
provider: options.provider,
networkType: options.networks[options.network].type
});
const web3 = new Web3Shim({
provider: options.provider,
networkType: options.networks[options.network].type
});
const resolver = new ResolverIntercept(options.resolver);
// Initial context.
const context = { web3, interfaceAdapter, config: this.config };
const deployer = new Deployer({
logger,
confirmations: options.confirmations,
configureNetwork({ networkType, provider } = {}) {
// otherwise use existing value as default (at most one of these)
networkType = networkType || this.networkType;
provider = provider || this.currentProvider;
// recreate interfaceAdapter
this.interfaceAdapter = createInterfaceAdapter({ networkType, provider });
// save properties
this.currentProvider = provider;
this.networkType = networkType;
},
exec: function(options, done) {
expect.options(options, [
"contracts_build_directory",
"file",
"resolver",
"provider",
"network",
"network_id"
]);
const interfaceAdapter = createInterfaceAdapter({
provider: options.provider,
networkType: options.networks[options.network].type
});
const web3 = new Web3Shim({
provider: options.provider,
networkType: options.networks[options.network].type
});
try {
const fn = this.file({
file: options.file,
context: { web3, interfaceAdapter },
resolver: options.resolver
});
fn(done);
} catch (error) {