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

test: show we can use namedtuples and web3 namedtuples #2171

Merged
merged 2 commits into from
Jul 8, 2024

Conversation

antazoey
Copy link
Member

@antazoey antazoey commented Jul 8, 2024

What I did

  • Show we can use namedtuples as inputs
  • Try out new web3 namedtuple functionality (I found an Structs with fields starting with underscores are not readable and clash with non-underscore fields ethereum/web3.py#3429)
  • Adding notes here:
    ** Unable to have underscore prefixed values in structs which is bad / breaking for Ape... I get it is rare but it is rather unfortunate. I don't see a reason to change our Struct to use namedtuple for reasons like this, also because the name in the namedtuple is not very dynamic in web3.py, it is the same name and not the name of the struct like it is in Ape. Ape's struct seems a lot more powerful so I am tempted to stick with that, albeit overengineered in some respects. I just can't rationalize changing to namedtuple at this time.

fixes: #1893

Checklist

  • All changes are completed
  • New test cases have been added
  • Documentation has been updated

@antazoey antazoey changed the title test: show we can use namedtuples test: show we can use namedtuples and demo results of trying web3 named tuples Jul 8, 2024
@antazoey antazoey changed the title test: show we can use namedtuples and demo results of trying web3 named tuples test: show we can use namedtuples and web3 namedtuples Jul 8, 2024
@antazoey antazoey requested a review from dtdang July 8, 2024 20:32
@antazoey antazoey merged commit c172e9d into ApeWorX:main Jul 8, 2024
17 checks passed
@antazoey antazoey deleted the feat/namedtuple branch July 8, 2024 23:08
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

Successfully merging this pull request may close these issues.

Check out new functionality of web3py for namedtuple support
2 participants