Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
plugin
Commits
21b28e61
Commit
21b28e61
authored
Nov 03, 2021
by
hezhengjun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make evm error info prettier
parent
b88d528a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
1 deletion
+17
-1
chain33.para.toml
chain33.para.toml
+1
-0
exec.go
plugin/dapp/evm/executor/exec.go
+14
-1
types.go
plugin/dapp/evm/types/types.go
+2
-0
No files found.
chain33.para.toml
View file @
21b28e61
...
...
@@ -300,6 +300,7 @@ ForkEVMFrozen=0
ForkEVMKVHash
=
0
ForkEVMYoloV1
=
0
ForkEVMTxGroup
=
0
ForkEVMRevertErrFormat
=
0
[fork.sub.blackwhite]
Enable
=
0
...
...
plugin/dapp/evm/executor/exec.go
View file @
21b28e61
...
...
@@ -116,7 +116,20 @@ func (evm *EVMExecutor) innerExec(msg *common.Message, txHash []byte, index int,
curVer
:=
evm
.
mStateDB
.
GetLastSnapshot
()
if
vmerr
!=
nil
{
log
.
Error
(
"evm contract exec error"
,
"error info"
,
vmerr
,
"ret"
,
string
(
ret
))
vmerr
=
errors
.
New
(
fmt
.
Sprintf
(
"%s,detail: %s"
,
vmerr
.
Error
(),
string
(
ret
)))
if
cfg
.
IsDappFork
(
evm
.
GetHeight
(),
"evm"
,
evmtypes
.
ForkEVMRevertErrFormat
)
{
var
visiableOut
[]
byte
for
i
:=
0
;
i
<
len
(
ret
);
i
++
{
//显示[32,126]之间的字符
if
ret
[
i
]
<
32
||
ret
[
i
]
>
126
{
continue
}
visiableOut
=
append
(
visiableOut
,
ret
[
i
])
}
vmerr
=
errors
.
New
(
fmt
.
Sprintf
(
"%s,detail: %s"
,
vmerr
.
Error
(),
string
(
visiableOut
)))
}
else
{
vmerr
=
errors
.
New
(
fmt
.
Sprintf
(
"%s,detail: %s"
,
vmerr
.
Error
(),
string
(
ret
)))
}
return
receipt
,
vmerr
}
...
...
plugin/dapp/evm/types/types.go
View file @
21b28e61
...
...
@@ -46,6 +46,8 @@ const (
ForkEVMYoloV1
=
"ForkEVMYoloV1"
//ForkEVMTxGroup 交易组中的交易通过GAS检查
ForkEVMTxGroup
=
"ForkEVMTxGroup"
//ForkEVMRevertErrFormat 执行失败错误信息格式
ForkEVMRevertErrFormat
=
"ForkEVMRevertErrFormat"
)
var
(
...
...
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