Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
d36fe1ce
Commit
d36fe1ce
authored
May 20, 2021
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix checkVMError params
parent
55e0e7ca
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
txExecution.ts
libs/remix-lib/src/execution/txExecution.ts
+4
-4
No files found.
libs/remix-lib/src/execution/txExecution.ts
View file @
d36fe1ce
...
@@ -57,7 +57,7 @@ export function callFunction (from, to, data, value, gasLimit, funAbi, txRunner,
...
@@ -57,7 +57,7 @@ export function callFunction (from, to, data, value, gasLimit, funAbi, txRunner,
* @param {Object} execResult - execution result given by the VM
* @param {Object} execResult - execution result given by the VM
* @return {Object} - { error: true/false, message: DOMNode }
* @return {Object} - { error: true/false, message: DOMNode }
*/
*/
export
function
checkVMError
(
tx
Result
,
abi
)
{
export
function
checkVMError
(
exec
Result
,
abi
)
{
const
errorCode
=
{
const
errorCode
=
{
OUT_OF_GAS
:
'out of gas'
,
OUT_OF_GAS
:
'out of gas'
,
STACK_UNDERFLOW
:
'stack underflow'
,
STACK_UNDERFLOW
:
'stack underflow'
,
...
@@ -75,10 +75,10 @@ export function checkVMError (txResult, abi) {
...
@@ -75,10 +75,10 @@ export function checkVMError (txResult, abi) {
error
:
false
,
error
:
false
,
message
:
''
message
:
''
}
}
if
(
!
txResult
.
result
.
execResult
.
exceptionError
)
{
if
(
!
execResult
.
exceptionError
)
{
return
ret
return
ret
}
}
const
exceptionError
=
txResult
.
result
.
execResult
.
exceptionError
.
error
||
''
const
exceptionError
=
execResult
.
exceptionError
.
error
||
''
const
error
=
`VM error:
${
exceptionError
}
.\n`
const
error
=
`VM error:
${
exceptionError
}
.\n`
let
msg
let
msg
if
(
exceptionError
===
errorCode
.
INVALID_OPCODE
)
{
if
(
exceptionError
===
errorCode
.
INVALID_OPCODE
)
{
...
@@ -88,7 +88,7 @@ export function checkVMError (txResult, abi) {
...
@@ -88,7 +88,7 @@ export function checkVMError (txResult, abi) {
msg
=
'
\
tThe transaction ran out of gas. Please increase the Gas Limit.
\
n'
msg
=
'
\
tThe transaction ran out of gas. Please increase the Gas Limit.
\
n'
ret
.
error
=
true
ret
.
error
=
true
}
else
if
(
exceptionError
===
errorCode
.
REVERT
)
{
}
else
if
(
exceptionError
===
errorCode
.
REVERT
)
{
const
returnData
=
txResult
.
result
.
execResult
.
returnValue
const
returnData
=
execResult
.
returnValue
const
returnDataHex
=
returnData
.
slice
(
0
,
4
).
toString
(
'hex'
)
const
returnDataHex
=
returnData
.
slice
(
0
,
4
).
toString
(
'hex'
)
let
customError
let
customError
if
(
abi
)
{
if
(
abi
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment