Closed abcoathup closed 3 years ago
It's possible to specify the Ganache configuration directly by including a node
field in test-environment.config.js
. See Configuration.
Actually, our node
configuration isn't enough because the options are serialized when sent to the Ganache node, and an instance of memdown wouldn't be properly forwarded.
Simple fix:
In file ganache-server.ts
:
import { Config, getConfig } from './config';
setupServer
, change the type of input argument nodeOptions
from NodeOptions
to any
const server = setupServer(options);
to:
const config: Config = getConfig();
const server: Server = setupServer({...options, ...config.node});
In file ganache-server.ts
, change this:
const gasPrice = typeof config.node.gasPrice === 'string' ? config.node.gasPrice : undefined;
const options: NodeOptions = {
...config.node,
gasPrice,
accounts: accountsConfig,
coverage: config.coverage,
};
To this:
const options: NodeOptions = {
accounts: accountsConfig,
coverage: false,
};
Would be happy to submit a PR if you authorize me.
Solved on v0.1.7. Thank you @frangio !
Ganache has the following option:
Requested in the forum: https://forum.openzeppelin.com/t/test-environment-configuration-for-db-memdown/4736