fix string array unpack bug in accounts/abi (#18364)
This commit is contained in:
committed by
Guillaume Ballet
parent
9e9fc87e70
commit
735343430d
@ -195,8 +195,15 @@ func toGoType(index int, t Type, output []byte) (interface{}, error) {
|
||||
|
||||
switch t.T {
|
||||
case SliceTy:
|
||||
if (*t.Elem).T == StringTy {
|
||||
return forEachUnpack(t, output[begin:], 0, end)
|
||||
}
|
||||
return forEachUnpack(t, output, begin, end)
|
||||
case ArrayTy:
|
||||
if (*t.Elem).T == StringTy {
|
||||
offset := int64(binary.BigEndian.Uint64(returnOutput[len(returnOutput)-8:]))
|
||||
return forEachUnpack(t, output[offset:], 0, t.Size)
|
||||
}
|
||||
return forEachUnpack(t, output, index, t.Size)
|
||||
case StringTy: // variable arrays are written at the end of the return bytes
|
||||
return string(output[begin : begin+end]), nil
|
||||
|
Reference in New Issue
Block a user