use current provider for gas price

pull/1/head
Iuri Matias 5 years ago
parent a3c926c751
commit da2065795f
  1. 2
      src/blockchain/blockchain.js
  2. 4
      src/blockchain/providers/injected.js
  3. 4
      src/blockchain/providers/node.js
  4. 4
      src/blockchain/providers/vm.js

@ -132,7 +132,7 @@ class Blockchain {
}
determineGasPrice (cb) {
this.executionContext.web3().eth.getGasPrice((error, gasPrice) => {
this.getCurrentProvider().getGasPrice((error, gasPrice) => {
const warnMessage = ' Please fix this issue before sending any transaction. '
if (error) {
return cb('Unable to retrieve the current network gas price.' + warnMessage + error)

@ -30,6 +30,10 @@ class InjectedProvider {
})
}
getGasPrice (cb) {
this.executionContext.web3().eth.getGasPrice(cb)
}
signMessage (message, account, _passphrase, cb) {
const hashedMsg = Web3.utils.sha3(message)
try {

@ -38,6 +38,10 @@ class NodeProvider {
})
}
getGasPrice (cb) {
this.executionContext.web3().eth.getGasPrice(cb)
}
signMessage (message, account, passphrase, cb) {
const hashedMsg = Web3.utils.sha3(message)
try {

@ -72,6 +72,10 @@ class VMProvider {
})
}
getGasPrice (cb) {
this.executionContext.web3().eth.getGasPrice(cb)
}
signMessage (message, account, _passphrase, cb) {
const personalMsg = ethJSUtil.hashPersonalMessage(Buffer.from(message))
const privKey = this.providers.vm.accounts[account].privateKey

Loading…
Cancel
Save