(Fix) Use `web3.utils.toWei` for zero gasPrice

This commit is contained in:
Vadim Arasev 2018-10-04 16:05:12 +03:00
parent ee4d4b4927
commit f39cf526b6
1 changed files with 6 additions and 3 deletions

View File

@ -38,10 +38,13 @@ export default class KeysManager {
}
createKeys({mining, voting, payout, sender}){
let gasPrice = this.web3_10.utils.toWei('2', 'gwei');
let gasPrice = '2';
if (this.netId === constants.NETID_DAI_TEST || this.netId === constants.NETID_DAI) {
gasPrice = 0;
gasPrice = '0';
}
return this.keysInstance.methods.createKeys(mining, voting, payout).send({from: sender, gasPrice});
return this.keysInstance.methods.createKeys(mining, voting, payout).send({
from: sender,
gasPrice: this.web3_10.utils.toWei(gasPrice, 'gwei')
});
}
}