Merge branch 'develop' of github.com:iurimatias/embark-framework into develop

This commit is contained in:
Iuri Matias 2018-01-17 11:24:26 -05:00
commit 7b58a770d9
3 changed files with 18 additions and 3 deletions

View File

@ -17,7 +17,9 @@
"wsOrigins": "http://localhost:8000",
"wsRPC": true,
"wsHost": "localhost",
"wsPort": 8546
"wsPort": 8546,
"simulatorMnemonic": "example exile argue silk regular smile grass bomb merge arm assist farm",
"simulatorBlocktime": 0
},
"testnet": {
"enabled": true,

View File

@ -17,7 +17,9 @@
"wsOrigins": "http://localhost:8000",
"wsRPC": true,
"wsHost": "localhost",
"wsPort": 8546
"wsPort": 8546,
"simulatorMnemonic": "example exile argue silk regular smile grass bomb merge arm assist farm",
"simulatorBlocktime": 0
},
"testnet": {
"enabled": true,

View File

@ -14,9 +14,20 @@ class Simulator {
cmds.push("-e " + (options.defaultBalance || 100));
cmds.push("-l " + (options.gasLimit || 8000000));
// adding mnemonic only if it is defined in the blockchainConfig or options
let simulatorMnemonic = this.blockchainConfig.simulatorMnemonic || options.simulatorMnemonic;
if (simulatorMnemonic) {
cmds.push("--mnemonic \"" + (simulatorMnemonic) +"\"");
}
// adding blocktime only if it is defined in the blockchainConfig or options
let simulatorBlocktime = this.blockchainConfig.simulatorBlocktime || options.simulatorBlocktime;
if (simulatorBlocktime) {
cmds.push("-b \"" + (simulatorBlocktime) +"\"");
}
shelljs.exec('testrpc ' + cmds.join(' '), {async : true});
}
}
module.exports = Simulator;