Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
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
张蕾
Geth-Modification
Commits
c2918c2f
Unverified
Commit
c2918c2f
authored
2 years ago
by
Ceyhun Onur
Committed by
GitHub
2 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
accounts/abi: return toGoType error immediately (#25565)
parent
052c6349
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
argument.go
accounts/abi/argument.go
+3
-3
unpack.go
accounts/abi/unpack.go
+3
-3
No files found.
accounts/abi/argument.go
View file @
c2918c2f
...
...
@@ -187,6 +187,9 @@ func (arguments Arguments) UnpackValues(data []byte) ([]interface{}, error) {
virtualArgs
:=
0
for
index
,
arg
:=
range
nonIndexedArgs
{
marshalledValue
,
err
:=
toGoType
((
index
+
virtualArgs
)
*
32
,
arg
.
Type
,
data
)
if
err
!=
nil
{
return
nil
,
err
}
if
arg
.
Type
.
T
==
ArrayTy
&&
!
isDynamicType
(
arg
.
Type
)
{
// If we have a static array, like [3]uint256, these are coded as
// just like uint256,uint256,uint256.
...
...
@@ -204,9 +207,6 @@ func (arguments Arguments) UnpackValues(data []byte) ([]interface{}, error) {
// coded as just like uint256,bool,uint256
virtualArgs
+=
getTypeSize
(
arg
.
Type
)
/
32
-
1
}
if
err
!=
nil
{
return
nil
,
err
}
retval
=
append
(
retval
,
marshalledValue
)
}
return
retval
,
nil
...
...
This diff is collapsed.
Click to expand it.
accounts/abi/unpack.go
View file @
c2918c2f
...
...
@@ -162,6 +162,9 @@ func forTupleUnpack(t Type, output []byte) (interface{}, error) {
virtualArgs
:=
0
for
index
,
elem
:=
range
t
.
TupleElems
{
marshalledValue
,
err
:=
toGoType
((
index
+
virtualArgs
)
*
32
,
*
elem
,
output
)
if
err
!=
nil
{
return
nil
,
err
}
if
elem
.
T
==
ArrayTy
&&
!
isDynamicType
(
*
elem
)
{
// If we have a static array, like [3]uint256, these are coded as
// just like uint256,uint256,uint256.
...
...
@@ -179,9 +182,6 @@ func forTupleUnpack(t Type, output []byte) (interface{}, error) {
// coded as just like uint256,bool,uint256
virtualArgs
+=
getTypeSize
(
*
elem
)
/
32
-
1
}
if
err
!=
nil
{
return
nil
,
err
}
retval
.
Field
(
index
)
.
Set
(
reflect
.
ValueOf
(
marshalledValue
))
}
return
retval
.
Interface
(),
nil
...
...
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