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

Remove Field.fromNumber(x) to reduce API surface area #486

Closed
jasongitmail opened this issue Oct 13, 2022 · 3 comments · Fixed by #519
Closed

Remove Field.fromNumber(x) to reduce API surface area #486

jasongitmail opened this issue Oct 13, 2022 · 3 comments · Fixed by #519
Assignees

Comments

@jasongitmail
Copy link
Contributor

Given Field(x) works equally well.

@mitschabaude
Copy link
Member

we have three similar methods, which all duplicate part of the Field() constructor

  static fromString(x: string): Field;
  static fromNumber(x: number): Field;
  static fromBigInt(x: bigint): Field;

the only things they add is to narrow down the types that are allowed as input. I'm not sure if that adds any value though, and haven't seen any of those three used in any actual code

@bkase
Copy link
Member

bkase commented Oct 24, 2022

Remove them on UInt* as well

@bkase
Copy link
Member

bkase commented Oct 24, 2022

Search the docs to make sure that these aren't referenced anywhere and fix them

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 a pull request may close this issue.

4 participants