Commit d36fe1ce authored by yann300's avatar yann300

fix checkVMError params

parent 55e0e7ca
......@@ -57,7 +57,7 @@ export function callFunction (from, to, data, value, gasLimit, funAbi, txRunner,
* @param {Object} execResult - execution result given by the VM
* @return {Object} - { error: true/false, message: DOMNode }
*/
export function checkVMError (txResult, abi) {
export function checkVMError (execResult, abi) {
const errorCode = {
OUT_OF_GAS: 'out of gas',
STACK_UNDERFLOW: 'stack underflow',
......@@ -75,10 +75,10 @@ export function checkVMError (txResult, abi) {
error: false,
message: ''
}
if (!txResult.result.execResult.exceptionError) {
if (!execResult.exceptionError) {
return ret
}
const exceptionError = txResult.result.execResult.exceptionError.error || ''
const exceptionError = execResult.exceptionError.error || ''
const error = `VM error: ${exceptionError}.\n`
let msg
if (exceptionError === errorCode.INVALID_OPCODE) {
......@@ -88,7 +88,7 @@ export function checkVMError (txResult, abi) {
msg = '\tThe transaction ran out of gas. Please increase the Gas Limit.\n'
ret.error = true
} else if (exceptionError === errorCode.REVERT) {
const returnData = txResult.result.execResult.returnValue
const returnData = execResult.returnValue
const returnDataHex = returnData.slice(0, 4).toString('hex')
let customError
if (abi) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment