mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
fix FixedBytesTy
This commit is contained in:
parent
9d81eaa8b2
commit
d94234d5f9
1 changed files with 3 additions and 1 deletions
|
|
@ -228,7 +228,9 @@ func parseTopicsIntoMap(out map[string]interface{}, fields abi.Arguments, topics
|
||||||
case abi.HashTy:
|
case abi.HashTy:
|
||||||
out[arg.Name] = topics[0]
|
out[arg.Name] = topics[0]
|
||||||
case abi.FixedBytesTy:
|
case abi.FixedBytesTy:
|
||||||
out[arg.Name] = topics[0][:]
|
array := reflect.New(arg.Type.Type).Elem()
|
||||||
|
reflect.Copy(array, reflect.ValueOf(topics[0][:arg.Type.Size]))
|
||||||
|
out[arg.Name] = array.Interface()
|
||||||
case abi.StringTy, abi.BytesTy, abi.SliceTy, abi.ArrayTy:
|
case abi.StringTy, abi.BytesTy, abi.SliceTy, abi.ArrayTy:
|
||||||
// Array types (including strings and bytes) have their keccak256 hashes stored in the topic- not a hash
|
// Array types (including strings and bytes) have their keccak256 hashes stored in the topic- not a hash
|
||||||
// whose bytes can be decoded to the actual value- so the best we can do is retrieve that hash
|
// whose bytes can be decoded to the actual value- so the best we can do is retrieve that hash
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue