Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eth_abi.exceptions.NoEntriesFound: No matching entries for 'tuple' in decoder registry #2298

Closed
Th0rgal opened this issue Jan 10, 2022 · 3 comments

Comments

@Th0rgal
Copy link

Th0rgal commented Jan 10, 2022

What was wrong?

It seems I am not able to decode events from my contract.

Solidity event:

    event PlotChange(bytes32 indexed location, Plot newPlot);

My python code:

        print("CODEC:", codec)
        print("LOG:", log)
        evt = get_event_data(codec, abi, log)
        print(evt)

Error code (and output):

CODEC: <eth_abi.codec.ABICodec object at 0x102929070>
LOG: AttributeDict({'address': '0x40B24f2A0F58E050233A3C19eb42f297df069bB8', 'blockHash': HexBytes('0x1af88b407390f70365dfe6590fe97011549fb683cb4619e6b4674f02fffc838a'), 'blockNumber': 1295972, 'data': '0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000061dc05430000000000000000000000000000000000000000000000000000000000000001', 'logIndex': 0, 'removed': False, 'topics': [HexBytes('0xb0b3ea803f5e36351f6eb0eec7e662cac0949697e039219aea060eb29f64a0d0'), HexBytes('0x0000000000000000000000000000000000000000000000000000000000000000')], 'transactionHash': HexBytes('0x4cb2c4dfe12d69ac27a3fb3379387dcbabd1afd87e13f0d7f587c07a2d27e342'), 'transactionIndex': 0})
Traceback (most recent call last):
  File "test.py", line 324, in _retry_web3_call
    return end_block, func(start_block, end_block)
  File "test.py", line 180, in _fetch_events
    return _fetch_events_for_all_contracts(self.web3,
  File "test.py", line 405, in _fetch_events_for_all_contracts
    evt = get_event_data(codec, abi, log)
  File "cytoolz/functoolz.pyx", line 250, in cytoolz.functoolz.curry.__call__
  File "/nix/store/czlg5442w24w6mbam890wcgkjf6vqgxd-python3-3.8.12-env/lib/python3.8/site-packages/web3/_utils/events.py", line 241, in get_event_data
    decoded_log_data = abi_codec.decode_abi(log_data_types, log_data)
  File "/nix/store/czlg5442w24w6mbam890wcgkjf6vqgxd-python3-3.8.12-env/lib/python3.8/site-packages/eth_abi/codec.py", line 173, in decode_abi
    decoders = [
  File "/nix/store/czlg5442w24w6mbam890wcgkjf6vqgxd-python3-3.8.12-env/lib/python3.8/site-packages/eth_abi/codec.py", line 174, in <listcomp>
    self._registry.get_decoder(type_str)
  File "/nix/store/czlg5442w24w6mbam890wcgkjf6vqgxd-python3-3.8.12-env/lib/python3.8/site-packages/eth_abi/registry.py", line 469, in get_decoder
    return self._get_registration(self._decoders, type_str)
  File "/nix/store/czlg5442w24w6mbam890wcgkjf6vqgxd-python3-3.8.12-env/lib/python3.8/site-packages/eth_abi/registry.py", line 354, in _get_registration
    coder = super()._get_registration(mapping, type_str)
  File "/nix/store/czlg5442w24w6mbam890wcgkjf6vqgxd-python3-3.8.12-env/lib/python3.8/site-packages/eth_abi/registry.py", line 336, in _get_registration
    value = mapping.find(type_str)
  File "/nix/store/czlg5442w24w6mbam890wcgkjf6vqgxd-python3-3.8.12-env/lib/python3.8/site-packages/eth_abi/registry.py", line 89, in find
    raise NoEntriesFound("No matching entries for '{}' in {}".format(
eth_abi.exceptions.NoEntriesFound: No matching entries for 'tuple' in decoder registry
WARNING:__main__:Retrying events for block range 1295961 - 1295981 (20) failed with No matching entries for 'tuple' in decoder registry, retrying in 3.0 seconds

I was connected through websockets,

How can it be fixed?

I don't know. I tried this version but it didn't fix anything: #2211


Note: We prefer to use issues to track our work. If you think you've encountered a bug in web3py or
have a feature request, you're in the right place. If you have implementation or usage questions,
please refer to our documentation and/or join the conversation
on discord.

@fselmo
Copy link
Collaborator

fselmo commented Jan 13, 2022

@Th0rgal Can you give this a shot with the latest updates to that PR and see if it resolves your issue?

@Th0rgal
Copy link
Author

Th0rgal commented Jan 14, 2022

Sure I will try to update, in the meantime here is what I did:

        location = log["topics"][1]
        x = int.from_bytes(location[:16], "big", signed=True)
        y = int.from_bytes(location[16:], "big", signed=True)
        colony_id = int.from_bytes(
            bytes.fromhex(log["data"][2:66]), "big", signed=False
        )

@fselmo
Copy link
Collaborator

fselmo commented Jan 14, 2022

I believe this should be fixed by updates to #2211. If this is still an issue after trying with that patch, please feel free to re-open.

@fselmo fselmo closed this as completed Jan 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants