Allow using Web3Factory in-process Ganache with existing snapshot
This commit is contained in:
parent
ffd8349889
commit
d01837f42c
@ -47,9 +47,12 @@ export const web3Factory = {
|
||||
_.isUndefined(config.shouldThrowErrorsOnGanacheRPCResponse) ||
|
||||
config.shouldThrowErrorsOnGanacheRPCResponse;
|
||||
if (!_.isUndefined(config.ganacheDatabasePath)) {
|
||||
// Saving the snapshot to a local db. Ganache requires this directory to exist
|
||||
const doesDatabaseAlreadyExist = fs.existsSync(config.ganacheDatabasePath);
|
||||
if (!doesDatabaseAlreadyExist) {
|
||||
// Working with local DB snapshot. Ganache requires this directory to exist
|
||||
fs.mkdirSync(config.ganacheDatabasePath);
|
||||
}
|
||||
}
|
||||
provider.addProvider(
|
||||
new GanacheSubprovider({
|
||||
vmErrorsOnRPCResponse: shouldThrowErrorsOnGanacheRPCResponse,
|
||||
|
Loading…
x
Reference in New Issue
Block a user