You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note the above linked event is a Transfer event with a to_address of 0x0000000000000000000000010000000000000000000000000000000000000006, which has invalid data in the padding bytes, but is a real event in the blockchain.
Traceback (most recent call last):
File "/Users/cwelton/projects/definitive/foo/repo.py", line 24, in <module>
get_event_data(TRANSFER_ABI, myevent)
File "/Users/cwelton/.pyenv/versions/3.9.11/lib/python3.9/site-packages/web3/utils/events.py", line 195, in get_event_data
decoded_topic_data = [
File "/Users/cwelton/.pyenv/versions/3.9.11/lib/python3.9/site-packages/web3/utils/events.py", line 196, in <listcomp>
decode_single(topic_type, topic_data)
File "/Users/cwelton/.pyenv/versions/3.9.11/lib/python3.9/site-packages/eth_abi/abi.py", line 80, in decode_single
return decoder(stream)
File "/Users/cwelton/.pyenv/versions/3.9.11/lib/python3.9/site-packages/eth_abi/decoding.py", line 118, in __call__
return self.decode(stream)
File "/Users/cwelton/.pyenv/versions/3.9.11/lib/python3.9/site-packages/eth_abi/decoding.py", line 189, in decode
self.validate_padding_bytes(value, padding_bytes)
File "/Users/cwelton/.pyenv/versions/3.9.11/lib/python3.9/site-packages/eth_abi/decoding.py", line 320, in validate_padding_bytes
raise NonEmptyPaddingBytes(
eth_abi.exceptions.NonEmptyPaddingBytes: Padding bytes were not empty: b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01'
What type of node you were connecting to?
Not needed to reproduce
How can it be fixed?
Provide an optional flag to get_event_data (or alternatively always) that would allow parse with warning rather than failing to parse.
The text was updated successfully, but these errors were encountered:
We could put this in our queue, but I'm not sure when we'll be able to get to it. I assume you've seen the processReceiptdocs? You can pass a flag to processReceipt. Also a word of caution: get_event_data isn't part of the public API, so it may change in minor version releases.
pip freeze
outputWhat was wrong?
Trying to decode an event with bad padding causes a NonEmptyPaddingBytes exception
Note the above linked event is a
Transfer
event with ato_address
of0x0000000000000000000000010000000000000000000000000000000000000006
, which has invalid data in the padding bytes, but is a real event in the blockchain.Not needed to reproduce
How can it be fixed?
Provide an optional flag to
get_event_data
(or alternatively always) that would allow parse with warning rather than failing to parse.The text was updated successfully, but these errors were encountered: