-
Notifications
You must be signed in to change notification settings - Fork 122
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
Foreign field operations #985
Conversation
This PR is officially revived! For the reviewer's convenience, here is the diff from the last review: d462e7c...4330a98 I made a bunch of changes to the original
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
* ``` | ||
* | ||
* Since asserting equality can also serve as a range check, | ||
* this method returns `x` with the appropriate type: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the pattern of utilizing types to better reflect the "state" of a value!
mina branch:feature/foreign-field-develop
(currently no changes but depends on an open PR)bindings: o1-labs/o1js-bindings#41closes #961
closes #963
This PR adds a
ForeignField
class, which is created by thecreateForeignField
class factory (taking the field modulus as parameter).ForeignField
aims for a DX similar to what developers are used to fromField
, with a subset of methods that should be powerful enough for most use cases.So far, all methods are "safe" and fully constrain their outputs, which allows to use the class with confidence and no inside knowledge. AnUnsafe
API which allows advanced developers to save some constraints will be added in a separate PR.EDIT: More info about recent changes in #985 (comment)