How to parse "string" from event topics? #1985
-
The smart contract has this event: The event hash is computed correctly: But when I parsed the topic the get the original string value using this code: I got this exception: What's the correct way to parse a |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I found the reason, |
Beta Was this translation helpful? Give feedback.
I found the reason,
string
is hashed when adding totopics
since its length is arbitrary. I added that value todata
and I can parse it correctly.Event( "Deposit", listOf( object : TypeReference<Address>(true) {}, object : TypeReference<Utf8String>(true) {}, object : TypeReference<Address>(true) {}, object : TypeReference<Utf8String>(false) {}, object : TypeReference<Uint256>(false) {}, ) )