diff --git a/src/blockchain/blockchain.js b/src/blockchain/blockchain.js index b1426c55e2..0a10bdd8e8 100644 --- a/src/blockchain/blockchain.js +++ b/src/blockchain/blockchain.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) diff --git a/src/blockchain/providers/injected.js b/src/blockchain/providers/injected.js index b62daea306..b8296d7349 100644 --- a/src/blockchain/providers/injected.js +++ b/src/blockchain/providers/injected.js @@ -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 { diff --git a/src/blockchain/providers/node.js b/src/blockchain/providers/node.js index 98a4ea1cf6..2cdb0a4ddc 100644 --- a/src/blockchain/providers/node.js +++ b/src/blockchain/providers/node.js @@ -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 { diff --git a/src/blockchain/providers/vm.js b/src/blockchain/providers/vm.js index 99eb6b0dbc..1ee22182ef 100644 --- a/src/blockchain/providers/vm.js +++ b/src/blockchain/providers/vm.js @@ -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