diff --git a/src/blockchain/blockchain.js b/src/blockchain/blockchain.js index 5dc6e69a3b..fbc60426fe 100644 --- a/src/blockchain/blockchain.js +++ b/src/blockchain/blockchain.js @@ -251,7 +251,9 @@ class Blockchain { logCallback(`${logMsg}`) } if (funABI.type === 'fallback') data.dataHex = value - this.callFunction(address, data, funABI, confirmationCb, continueCb, promptCb, (error, txResult, _address, returnValue) => { + + const useCall = funABI.stateMutability === 'view' || funABI.stateMutability === 'pure' + this.runTx({address, data, useCall}, confirmationCb, continueCb, promptCb, (error, txResult, _address, returnValue) => { if (error) { return logCallback(`${logMsg} errored: ${error} `) } @@ -341,19 +343,6 @@ class Blockchain { return Object.keys(this.txRunner.pendingTxs).length } - /** - * call the current given contract - * - * @param {String} to - address of the contract to call. - * @param {String} data - data to send with the transaction ( return of txFormat.buildData(...) ). - * @param {Object} funAbi - abi definition of the function to call. - * @param {Function} callback - callback. - */ - callFunction (to, data, funAbi, confirmationCb, continueCb, promptCb, callback) { - const useCall = funAbi.stateMutability === 'view' || funAbi.stateMutability === 'pure' - this.runTx({to, data, useCall}, confirmationCb, continueCb, promptCb, callback) - } - /** * This function send a tx only to javascript VM or testnet, will return an error for the mainnet * SHOULD BE TAKEN CAREFULLY!