feat(nargo): add skeleton of composite types in template input tomls #1104
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related issue(s)
Resolves #
Description
Summary of changes
Consider the program
Currently this gets templated into
Prover.toml
bynargo check
asThis adds unnecessary friction as
d
is really a table and will need to be moved down to the bottom of the file and the user is responsible for adding all of its fields. This can lead to an annoying back and forth withABIError
s when trying to fill in this file.To address this, we now template each
AbiType
recursively to produceUsers no longer have to rebuild their struct types or worry about lengths of array, just replace anywhere there's a
""
with an actual value.Dependency additions / changes
Test additions / changes
I've added a test as a smoke test for this.
Checklist
cargo fmt
with default settings.Documentation needs
Any examples of generated
Prover.toml
files in the docs need to be updated if they contain structs or arrays.Additional context