update parseTopicsIntoMap to handle strings

This commit is contained in:
Ian Norden
2019-03-12 13:36:23 -05:00
parent 8bd397e2eb
commit ac93139863
2 changed files with 12 additions and 1 deletions
+10
View File
@@ -218,6 +218,16 @@ func parseTopicsIntoMap(out map[string]interface{}, fields abi.Arguments, topics
out[arg.Name] = topics[0]
case abi.BytesTy, abi.FixedBytesTy:
out[arg.Name] = topics[0][:]
case abi.StringTy:
bytes := topics[0].Bytes()
var trimmedBytes []byte
for i, by := range bytes {
if by != 0 {
trimmedBytes = bytes[i:]
break
}
}
out[arg.Name] = string(trimmedBytes)
default:
}