@coinmeca/ethers
Version:
Solidty helpers and utilities for using ethers.
39 lines (38 loc) • 1.41 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.deploy = deploy;
exports.scenario = scenario;
exports.unit = unit;
const config = { shell: true, stdio: 'inherit' };
function deploy() {
let network = '';
require('child_process').spawn('npx', [
'hardhat run',
`scripts/deploy/${process.argv[2].replaceAll('.', '/')}.ts`,
process.argv[3] && process.argv[3].startsWith('--') ? '--network' : '',
...process.argv.map((arg, i) => {
if (i > 2)
if (arg.startsWith('--'))
return network = arg.substring(2, process.argv[3].length);
else
arg;
})
], config);
process.argv[3] && console.log('\n' + '📡 Network: ' + network.replaceAll('-', ' ').replaceAll('_', ' ').replaceAll('.', ' ').replaceAll(' ', ' ').replaceAll(' ', ' ') + '\n');
}
function scenario() {
require('child_process').spawn('npx', [
'hardhat test',
`test/scenarios/${process.argv[2].replaceAll('.', '/')}`,
...process.argv.map((arg, i) => { if (i > 2)
return arg; })
], config);
}
function unit() {
require('child_process').spawn('npx', [
'hardhat test',
`test/units/${process.argv[2].replaceAll('.', '/')}`,
...process.argv.map((arg, i) => { if (i > 2)
return arg; })
], config);
}