|
|
|
@ -249,7 +249,7 @@ class Blockchain { |
|
|
|
|
return txlistener |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
runOrCallContractMethod (contractName, contractAbi, funABI, value, address, callType, lookupOnly, logMsg, logCallback, outputCb, confirmationCb, continueCb, promptCb) { |
|
|
|
|
runOrCallContractMethod (contractName, contractAbi, funABI, contract, value, address, callType, lookupOnly, logMsg, logCallback, outputCb, confirmationCb, continueCb, promptCb) { |
|
|
|
|
// contractsDetails is used to resolve libraries
|
|
|
|
|
txFormat.buildData(contractName, contractAbi, {}, false, funABI, callType, (error, data) => { |
|
|
|
|
if (error) { |
|
|
|
@ -265,6 +265,7 @@ class Blockchain { |
|
|
|
|
if (data) { |
|
|
|
|
data.contractName = contractName |
|
|
|
|
data.contractABI = contractAbi |
|
|
|
|
data.contract = contract |
|
|
|
|
} |
|
|
|
|
const useCall = funABI.stateMutability === 'view' || funABI.stateMutability === 'pure' |
|
|
|
|
this.runTx({ to: address, data, useCall }, confirmationCb, continueCb, promptCb, (error, txResult, _address, returnValue) => { |
|
|
|
@ -490,7 +491,7 @@ class Blockchain { |
|
|
|
|
if (execResult) { |
|
|
|
|
// if it's not the VM, we don't have return value. We only have the transaction, and it does not contain the return value.
|
|
|
|
|
returnValue = execResult ? execResult.returnValue : toBuffer(addHexPrefix(txResult.result) || '0x0000000000000000000000000000000000000000000000000000000000000000') |
|
|
|
|
const vmError = txExecution.checkVMError(execResult, args.data.contractABI) |
|
|
|
|
const vmError = txExecution.checkVMError(execResult, args.data.contractABI, args.data.contract) |
|
|
|
|
if (vmError.error) { |
|
|
|
|
return cb(vmError.message) |
|
|
|
|
} |
|
|
|
|