-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Allow arrays of arbitrary types in the program ABI (#1651)
* chore: refactor `InputValue` to accept arrays of `InputValues` * chore: generalize `TomlTypes` and `JsonTypes` to have a single array type * chore: add test for arrays of structs in program ABI * chore: use `vecmap` over plain iterators * chore: improve functions to convert to `InputValue` * chore: remove restrictions on array element types * chore: clippy * chore: remove stale comment * chore: move new test case to be run on experimental ssa
- Loading branch information
1 parent
0d85752
commit 811ede1
Showing
8 changed files
with
76 additions
and
101 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
crates/nargo_cli/tests/test_data_ssa_refactor/struct_array_inputs/Nargo.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[package] | ||
authors = [""] | ||
compiler_version = "0.6.0" | ||
|
||
[dependencies] |
11 changes: 11 additions & 0 deletions
11
crates/nargo_cli/tests/test_data_ssa_refactor/struct_array_inputs/Prover.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[[foos]] | ||
bar = 0 | ||
baz = 0 | ||
|
||
[[foos]] | ||
bar = 0 | ||
baz = 0 | ||
|
||
[[foos]] | ||
bar = 1 | ||
baz = 2 |
8 changes: 8 additions & 0 deletions
8
crates/nargo_cli/tests/test_data_ssa_refactor/struct_array_inputs/src/main.nr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
struct Foo { | ||
bar: Field, | ||
baz: Field, | ||
} | ||
|
||
fn main(foos: [Foo; 3]) -> pub Field { | ||
foos[2].bar + foos[2].baz | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters