-
Notifications
You must be signed in to change notification settings - Fork 226
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
Replace toml_map_to_field
and toml_remap
with traits to map between InputValue
s and TomlTypes
#677
Replace toml_map_to_field
and toml_remap
with traits to map between InputValue
s and TomlTypes
#677
Conversation
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.
Looks great, just one style comment that you can choose to ignore if you wish. Seems like we need to re-run the CI as well.
Looks like this will end up incompatible with #622 due to it requiring context about whether a particular value is a field or a string which we can't pass to |
I like the move away from |
I believe the reason PR #622 adds the type-aware conversions is to keep allowing |
To my knowledge toml does not allow unquoted hexadecimal literals and that is why we use strings for hexadecimal inputs. If toml does allow unquoted hex literals I agree we should just remove support for the quoted ones to avoid confusion. |
It does support hex representations of integers however integers are limited to values which fit in an |
5f97e69
to
8aa0696
Compare
8aa0696
to
e23da12
Compare
…ue::try_from_toml
I've rebased this back on top of master to support string types. |
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.
👍
* master: Rename methods that use `conditionalize` to be more descriptive (#739) feat(noir)!: Returned values are no longer required by the prover (#731) chore: explicit versions for dependencies (#727) chore: readability improvements (#726) feat(nargo): include short git commit in cli version output (#721) Remove print to console for named proofs in `nargo prove` (#718) chore: clean up serde-related dependencies (#722) Handle out-of-bound errors in CSE (#471) (#673) Remove unused dependencies and only use workspace inheritance on shared deps (#671) feat(std_lib)!: modulus bits/bytes methods, and to_bits -> to_le_bits (#697) Implement numeric generics (#620) Review some TODO in SSA (#698) Replace `toml_map_to_field` and `toml_remap` with traits to map between `InputValue`s and `TomlTypes` (#677) Apply witness visibility on a parameter level rather than witness level (#712)
Related issue(s)
Description
Summary of changes
I've replaced the functions
toml_map_to_field
andtoml_remap
with implementations ofTomlTypes::from<InputValue>()
andInputValue::try_from<TomlTypes>()
, i.e. rather than mapping the entire set of arguments at once we specify how to map a single input from one type to another.We can then just iterate over each argument and map them individually.
Dependency additions / changes
N/A
Test additions / changes
N/A
Checklist
cargo fmt
with default settings.Additional context