1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-23 02:10:12 +01:00
metamask-extension/test/e2e/ganache.js
PeterYinusa 12943e0e71
[E2E]: Set approval for all e2e (#15481)
* Update test dapp

* fix provider

fix provider
remove debug
mint nft

* Add collectibles spec

Co-authored-by: Alex Donesky <adonesky@gmail.com>
2022-08-09 14:59:20 +01:00

35 lines
715 B
JavaScript

const ganache = require('ganache');
const defaultOptions = {
blockTime: 2,
network_id: 1337,
mnemonic:
'phrase upgrade clock rough situate wedding elder clever doctor stamp excess tent',
port: 8545,
vmErrorsOnRPCResponse: false,
hardfork: 'muirGlacier',
quiet: true,
};
class Ganache {
async start(opts) {
const options = { ...defaultOptions, ...opts };
const { port } = options;
this._server = ganache.server(options);
await this._server.listen(port);
}
getProvider() {
return this._server.provider;
}
async quit() {
if (!this._server) {
throw new Error('Server not running yet');
}
await this._server.close();
}
}
module.exports = Ganache;