accounts/abi: fix event unpack into slice
+ The event slice unpacker doesn't correctly extract element from the slice. The indexed arguments are not ignored as they should be (the data offset should not include the indexed arguments). + The `Elem()` call in the slice unpack doesn't work. The Slice related tests fails because of that. + the check in the loop are suboptimal and have been extracted out of the loop. + extracted common code from event and method tupleUnpack
This commit is contained in:
committed by
Martin Holst Swende
parent
9becba5540
commit
0ed8b838a9
@ -49,3 +49,13 @@ func (a *Argument) UnmarshalJSON(data []byte) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func countNonIndexedArguments(args []Argument) int {
|
||||
out := 0
|
||||
for i := range args {
|
||||
if !args[i].Indexed {
|
||||
out++
|
||||
}
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
Reference in New Issue
Block a user