-
Notifications
You must be signed in to change notification settings - Fork 365
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 target-ethers-v5 to allow transaction and contract call overrides #254
Fix target-ethers-v5 to allow transaction and contract call overrides #254
Conversation
@bradennapier Thanks for finding the target's shortcomings and creating the PR, I'll try your PR this evening in my project and confirm. |
this looks good @bradennapier! Thanks for the review @zemse! Did you have a chance to try it out? @bradennapier The formatting changes that you mentioned are fine - prettier reformatted generated types because of a new argument. |
I just tried this PR in my project and didn't get any issues. LGTM! |
Yeah we ran through on our new contracts at IDEX, which are quite extensive, and they all work well! The changes on v4 are essential as well since it is plagued with the same issue - we tested on both since we use both versions atm. |
@krzkaczor any update on this? would love to see it deployed so we can stop using our symlinked versions :-) |
Sorry @bradennapier i will get this PRs merged today. |
Thanks! Published as |
According to https://docs.ethers.io/v5/api/contract/contract/#Contract--check the signature of the
estimateGas
,populateTransaction
and others should allow for overrides. These are not currently being built making it impossible to call them in many cases.This simply reproduces the logic done for the functions which are produced correctly by adding the overrides (and documentation) for those calls.
Given the ERC-20 example which is better types by ethers: https://docs.ethers.io/v5/api/contract/example/#example-erc-20-contract--meta-class-methods
Before
After
This also handles the payable example properly since it is just reusing your previous logic:
from:
to:
The 3 PR's combined, which we are using to generate working types for our contracts is https://github.com/bradennapier/TypeChain/tree/combined-prs