-
Notifications
You must be signed in to change notification settings - Fork 271
Closed
Description
- Version: df3fc70 (master at creation time)
- Python: 3.6
- OS: linux
What was wrong?
I would expect that decoding an abi value of string
would return a str
-typed value.
In [1]: from eth_abi import decode_abi
In [2]: decode_abi(['string'], b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05mystr\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
Out[2]: (b'mystr',)
I expected ('mystr',)
How can it be fixed?
Last step of decoding should be to call .decode('utf8')
on a bytes value if using a string decoder.
Metadata
Metadata
Assignees
Labels
No labels