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
08658806
Unverified
Commit
08658806
authored
Aug 19, 2022
by
zhiqiangxu
Committed by
GitHub
Aug 19, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
accounts/abi: fix set function (#25477)
* accounts/abi: fix set function * don't break things * update test
parent
36874b63
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
reflect.go
accounts/abi/reflect.go
+1
-1
unpack_test.go
accounts/abi/unpack_test.go
+5
-0
No files found.
accounts/abi/reflect.go
View file @
08658806
...
...
@@ -99,7 +99,7 @@ func mustArrayToByteSlice(value reflect.Value) reflect.Value {
func
set
(
dst
,
src
reflect
.
Value
)
error
{
dstType
,
srcType
:=
dst
.
Type
(),
src
.
Type
()
switch
{
case
dstType
.
Kind
()
==
reflect
.
Interface
&&
dst
.
Elem
()
.
IsValid
()
:
case
dstType
.
Kind
()
==
reflect
.
Interface
&&
dst
.
Elem
()
.
IsValid
()
&&
(
dst
.
Elem
()
.
Type
()
.
Kind
()
==
reflect
.
Ptr
||
dst
.
Elem
()
.
CanSet
())
:
return
set
(
dst
.
Elem
(),
src
)
case
dstType
.
Kind
()
==
reflect
.
Ptr
&&
dstType
.
Elem
()
!=
reflect
.
TypeOf
(
big
.
Int
{})
:
return
set
(
dst
.
Elem
(),
src
)
...
...
accounts/abi/unpack_test.go
View file @
08658806
...
...
@@ -352,6 +352,11 @@ func TestMethodMultiReturn(t *testing.T) {
&
[]
interface
{}{
&
expected
.
Int
,
&
expected
.
String
},
""
,
"Can unpack into a slice"
,
},
{
&
[]
interface
{}{
&
bigint
,
""
},
&
[]
interface
{}{
&
expected
.
Int
,
expected
.
String
},
""
,
"Can unpack into a slice without indirection"
,
},
{
&
[
2
]
interface
{}{
&
bigint
,
new
(
string
)},
&
[
2
]
interface
{}{
&
expected
.
Int
,
&
expected
.
String
},
...
...
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