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

Error parsing function that takes input as a struct. #102

Closed
sarinniural opened this issue Jan 26, 2023 · 2 comments
Closed

Error parsing function that takes input as a struct. #102

sarinniural opened this issue Jan 26, 2023 · 2 comments

Comments

@sarinniural
Copy link

sarinniural commented Jan 26, 2023

I am trying to use the decoder, but it fails with the exception as follows.
Maybe this can help ethereum/web3.py#2211

ABI is here https://goerli.etherscan.io/address/0xADF688869E47D404af9aaD295e09Efa06bbAD593#code

def parse_function(input):
    decoder = InputDecoder(abi)
    result = decoder.decode_function(input)
    print(result)


parse_function(
    "0xe024c9080000000000000000000000000000000000000000000000000000000000000060000000000000000000000000cc4741e83b3c07284ba04d47ae04bb1592aeeff500000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000002434646465363836662d343730612d343035362d616336302d3839636163623061363037610000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000008584e41974f927d33f3801f5d87113a2abc8258d0000000000000000000000000000000000000000000000000000000040ac1760"
)


  File "test.py", line 121, in <module>
    parse_function(
  File "test.py", line 117, in parse_function
    result = decoder.decode_function(input)
  File "/Users/sarinregmi/.pyenv/versions/3.8.14/lib/python3.8/site-packages/web3_input_decoder/decoder.py", line 35, in decode_function
    values = decode(types, args)
  File "/Users/sarinregmi/.pyenv/versions/3.8.14/lib/python3.8/site-packages/eth_abi/codec.py", line 208, in decode
    decoders = [self._registry.get_decoder(type_str) for type_str in types]
  File "/Users/sarinregmi/.pyenv/versions/3.8.14/lib/python3.8/site-packages/eth_abi/codec.py", line 208, in <listcomp>
    decoders = [self._registry.get_decoder(type_str) for type_str in types]
  File "/Users/sarinregmi/.pyenv/versions/3.8.14/lib/python3.8/site-packages/eth_abi/registry.py", line 488, in get_decoder
    return self._get_registration(self._decoders, type_str)
  File "/Users/sarinregmi/.pyenv/versions/3.8.14/lib/python3.8/site-packages/eth_abi/registry.py", line 370, in _get_registration
    return coder.from_type_str(type_str, self)
  File "/Users/sarinregmi/.pyenv/versions/3.8.14/lib/python3.8/site-packages/eth_abi/base.py", line 74, in new_from_type_str
    return old_from_type_str(cls, abi_type, registry)
  File "/Users/sarinregmi/.pyenv/versions/3.8.14/lib/python3.8/site-packages/eth_abi/decoding.py", line 233, in from_type_str
    item_decoder = registry.get_decoder(abi_type.item_type.to_type_str())
  File "/Users/sarinregmi/.pyenv/versions/3.8.14/lib/python3.8/site-packages/eth_abi/registry.py", line 488, in get_decoder
    return self._get_registration(self._decoders, type_str)
  File "/Users/sarinregmi/.pyenv/versions/3.8.14/lib/python3.8/site-packages/eth_abi/registry.py", line 367, in _get_registration
    coder = super()._get_registration(mapping, type_str)
  File "/Users/sarinregmi/.pyenv/versions/3.8.14/lib/python3.8/site-packages/eth_abi/registry.py", line 349, in _get_registration
    value = mapping.find(type_str)
  File "/Users/sarinregmi/.pyenv/versions/3.8.14/lib/python3.8/site-packages/eth_abi/registry.py", line 94, in find
    raise NoEntriesFound(
eth_abi.exceptions.NoEntriesFound: No matching entries for 'tuple' in decoder registry
@sarinniural
Copy link
Author

I figured out that the issue happens if I have the web3 dependency pip installed. Removing web3 and installing this package again resolved the issue

@kigawas
Copy link
Owner

kigawas commented Jan 29, 2023

Probably caused by eth-abi or eth-utils version discrepancy. Glad you have solved it :)

@kigawas kigawas closed this as completed Jan 29, 2023
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