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

fix: name clashes #887

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

jfschwarz
Copy link

@jfschwarz jfschwarz commented Dec 8, 2023

closes #886

The ethers v6 reservedKeywords set was quite outdated. It had ethers v5 contract property names that no longer exist for v6 contracts (e.g.: provider) and was missing some v6 contract property names (e.g.: target). Rather than attempting to manually keep the reservedKeywords list up-to-date, I'd propose to directly read the list of built-in properties from the BaseContract class.

The then property is a peculiar case. It's not a property of BaseContract, but still won't be passed through by ethers as it is kept in a special passProperties list (see: ethers v6 BaseContract Proxy).

Copy link

changeset-bot bot commented Dec 8, 2023

🦋 Changeset detected

Latest commit: 083dea0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@typechain/ethers-v5 Patch
@typechain/ethers-v6 Patch
test-e2e Patch
@typechain/hardhat Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@jfschwarz jfschwarz changed the title Fix ethers v6 name clashes fix(ethers-v6): name clashes Dec 8, 2023
@krzkaczor
Copy link
Member

@jfschwarz thanks for this PR! Can you have a look at failing CI (typecheck task)?

@jfschwarz jfschwarz changed the title fix(ethers-v6): name clashes fix: name clashes Jan 9, 2024
@jfschwarz
Copy link
Author

jfschwarz commented Jan 9, 2024

Thank you, @krzkaczor! The failing CI typecheck tasks actually only reveal that ethers-v5 suffered under the same issue, so I went ahead and applied the fix also to that package.

Unfortunately, the dev tooling in that package appears a bit broken for me. I'm getting plenty of lint errors in target-ethers-v5 that don't seem to make make sense, not sure what's going on... I would appreciate if you could run the CI pipeline again to see if my latest changes check out.

compojoom added a commit to compojoom/zodiac that referenced this pull request Jan 11, 2024
Unfortunately there is a bug in typechain and we get some name clashes in the generated code. There is a PR that fixes this, but until it gets merged I’ve added a patch.
More info on the name clash:
dethcrypto/TypeChain#887

Once this PR is merged the patch could be removed.
compojoom added a commit to compojoom/zodiac that referenced this pull request Jan 12, 2024
Unfortunately there is a bug in typechain and we get some name clashes in the generated code. There is a PR that fixes this, but until it gets merged I’ve added a patch.
More info on the name clash:
dethcrypto/TypeChain#887

Once this PR is merged the patch could be removed.
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.

Generated types are broken if contract function names clash with ethers built-ins
2 participants