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

Duplicate length properties on responses #40

Open
jackmellis opened this issue May 23, 2022 · 4 comments
Open

Duplicate length properties on responses #40

jackmellis opened this issue May 23, 2022 · 4 comments

Comments

@jackmellis
Copy link

If a contract method response has a length property on it, the generator creates an interface something like this:

interface SomeMethodResponse {
  someProperty: boolean;
  0: boolean;
  someOtherProperty: BigNumber;
  1: BigNumber;
  length: BigNumber;
  2: BigNumber;
  length: 3;
}

the two conflicting length properties cause typescript (and esilnt) errors. I think that (at least for ethersv5) if you have a length property, it gets renamed to _length so I think this should mimic that behaviour...

@joshstevens19
Copy link
Owner

oh good catch.. so to confirm you have something called "length" on ABI ethers turns it to _length right? or the other way around?

@jackmellis
Copy link
Author

That's correct, yes.

@joshstevens19
Copy link
Owner

good to know will look at both your issues the type one may be a bit more of a rewrite but we should support it thanks for raising

@jackmellis
Copy link
Author

Thanks for the quick response ❤️

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