From d94234d5f9955a0b1a901102598604667898d207 Mon Sep 17 00:00:00 2001 From: Jeff Wentworth Date: Tue, 12 Nov 2019 21:05:02 +0900 Subject: [PATCH] fix FixedBytesTy --- accounts/abi/bind/topics.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/accounts/abi/bind/topics.go b/accounts/abi/bind/topics.go index 45978641ae..dfb40f122d 100644 --- a/accounts/abi/bind/topics.go +++ b/accounts/abi/bind/topics.go @@ -228,7 +228,9 @@ func parseTopicsIntoMap(out map[string]interface{}, fields abi.Arguments, topics case abi.HashTy: out[arg.Name] = topics[0] 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: // 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