Commit 1e78adc2 by Francisco Giordano

Refactor buidler config

parent fcdf8f46
const fs = require('fs');
const path = require('path');
usePlugin('solidity-coverage'); usePlugin('solidity-coverage');
usePlugin('@nomiclabs/buidler-truffle5'); usePlugin('@nomiclabs/buidler-truffle5');
extendEnvironment(env => { for (const f of fs.readdirSync(path.join(__dirname, 'buidler'))) {
const { contract } = env; require(path.join(__dirname, 'buidler', f));
env.contract = function (name, body) { }
// remove the default account from the accounts list used in tests, in order
// to protect tests against accidentally passing due to the contract
// deployer being used subsequently as function caller
contract(name, accounts => body(accounts.slice(1)));
};
});
module.exports = { module.exports = {
networks: { networks: {
......
extendEnvironment(env => {
const { contract } = env;
env.contract = function (name, body) {
// remove the default account from the accounts list used in tests, in order
// to protect tests against accidentally passing due to the contract
// deployer being used subsequently as function caller
contract(name, accounts => body(accounts.slice(1)));
};
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment