Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
新注册的用户请输入邮箱并保存,随后登录邮箱激活账号。后续可直接使用邮箱登录!
Open sidebar
T BaaS
common
Commits
596c52a4
Commit
596c52a4
authored
2 years ago
by
Devin Zeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: Evm abi don't support bytes hex string
--story=1011659
parent
47574eda
v2.3.0_qc
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
evmutils/abi/burrow/abi/primitives.go
evmutils/abi/burrow/abi/primitives.go
+9
-1
No files found.
evmutils/abi/burrow/abi/primitives.go
View file @
596c52a4
...
...
@@ -2,6 +2,7 @@ package abi
import
(
"encoding/binary"
"encoding/hex"
"fmt"
"math/big"
"reflect"
...
...
@@ -613,12 +614,19 @@ func (e EVMBytes) getGoType() interface{} {
return
&
v
}
var
reghex
=
regexp
.
MustCompile
(
"0[xX][0-9a-fA-F]+"
)
func
(
e
EVMBytes
)
pack
(
v
interface
{})
([]
byte
,
error
)
{
b
,
ok
:=
v
.
([]
byte
)
if
!
ok
{
s
,
ok
:=
v
.
(
string
)
if
ok
{
b
=
[]
byte
(
s
)
//如果是16进制,则进行转换
if
reghex
.
MatchString
(
s
)
{
b
,
_
=
hex
.
DecodeString
(
s
[
2
:
])
}
else
{
b
=
[]
byte
(
s
)
}
}
else
{
return
nil
,
fmt
.
Errorf
(
"cannot map from %s to EVM bytes"
,
reflect
.
ValueOf
(
v
)
.
Kind
()
.
String
())
}
...
...
This diff is collapsed.
Click to expand it.
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