Skip to content

Commit a0381ed

Browse files
committed
fixed indexed log params decoding
1 parent 03325a3 commit a0381ed

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

internal/common/log.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,7 @@ func decodeIndexedArgument(argType abi.Type, topic string) (interface{}, error)
188188
return new(big.Int).SetBytes(topicBytes), nil
189189
case abi.BoolTy:
190190
return topicBytes[0] != 0, nil
191-
case abi.StringTy:
192-
return string(topicBytes), nil
193-
case abi.BytesTy, abi.FixedBytesTy:
191+
case abi.BytesTy, abi.FixedBytesTy, abi.StringTy:
194192
return "0x" + gethCommon.Bytes2Hex(topicBytes), nil
195193
case abi.HashTy:
196194
if len(topicBytes) != 32 {
@@ -201,10 +199,8 @@ func decodeIndexedArgument(argType abi.Type, topic string) (interface{}, error)
201199
bi := new(big.Int).SetBytes(topicBytes)
202200
bf := new(big.Float).SetInt(bi)
203201
return bf, nil
204-
case abi.SliceTy, abi.ArrayTy, abi.TupleTy:
205-
return nil, fmt.Errorf("type %s is not supported for indexed parameters", argType.String())
206202
default:
207-
return nil, fmt.Errorf("unsupported indexed type: %s", argType.String())
203+
return topic, nil
208204
}
209205
}
210206

0 commit comments

Comments
 (0)