From a5368fb12aa92980f2ac1038687786787b06816c Mon Sep 17 00:00:00 2001 From: collin <16715212+collinc97@users.noreply.github.com> Date: Mon, 24 Jan 2022 16:15:17 -0800 Subject: [PATCH 1/3] comment out wasm ci --- .github/workflows/wasm.yml | 78 +++++++++++++++++++------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/.github/workflows/wasm.yml b/.github/workflows/wasm.yml index c2363ac026..19ae5d92ff 100644 --- a/.github/workflows/wasm.yml +++ b/.github/workflows/wasm.yml @@ -1,39 +1,39 @@ -name: WASM -on: - pull_request: - push: - branches: - - master - - staging - - trying - paths-ignore: - - 'docs/**' - - 'documentation/**' -env: - RUST_BACKTRACE: 1 - -jobs: - test-wasm-parser: - name: Test on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - defaults: - run: - working-directory: wasm - strategy: - matrix: - os: [windows-latest] - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Install Rust Stable - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - name: Install wasm-pack - run: cargo install wasm-pack - - name: Run wasm-pack - run: wasm-pack build --dev --target nodejs - - name: Install dependencies and run tests - run: cd tests && npm ci && npm test +#name: WASM +#on: +# pull_request: +# push: +# branches: +# - master +# - staging +# - trying +# paths-ignore: +# - 'docs/**' +# - 'documentation/**' +#env: +# RUST_BACKTRACE: 1 +# +#jobs: +# test-wasm-parser: +# name: Test on ${{ matrix.os }} +# runs-on: ${{ matrix.os }} +# defaults: +# run: +# working-directory: wasm +# strategy: +# matrix: +# os: [windows-latest] +# steps: +# - name: Checkout +# uses: actions/checkout@v2 +# - name: Install Rust Stable +# uses: actions-rs/toolchain@v1 +# with: +# profile: minimal +# toolchain: stable +# override: true +# - name: Install wasm-pack +# run: cargo install wasm-pack +# - name: Run wasm-pack +# run: wasm-pack build --dev --target nodejs +# - name: Install dependencies and run tests +# run: cd tests && npm ci && npm test From 31f90a9032b7cd8927021f0be9f44f521f69d23e Mon Sep 17 00:00:00 2001 From: collin <16715212+collinc97@users.noreply.github.com> Date: Tue, 25 Jan 2022 13:31:02 -0800 Subject: [PATCH 2/3] deprecate blake2s --- .github/workflows/wasm.yml | 78 +++++++++---------- .../src/{prelude => deprecated}/blake2s.rs | 0 compiler/src/expression/expression.rs | 29 +++---- compiler/src/prelude/mod.rs | 3 - stdlib/README.md | 5 +- .../_blake2s/arguments_length_fail.leo | 0 .../_blake2s/arguments_type_fail.leo | 0 .../_blake2s/blake2s_input.leo | 0 .../_blake2s/blake2s_random.leo | 0 .../_blake2s/inputs/valid_input.in | 0 .../unstable => deprecated}/_blake2s/mod.rs | 0 .../_blake2s/outputs/valid_output.out | 0 .../stdlib => deprecated}/blake2s.leo | 0 .../core_circuit_invalid.leo | 0 .../core_circuit_invalid.leo.out | 0 .../out_of_order_with_import.leo | 0 .../out_of_order_with_import.leo.out | 0 .../unstable_blake2s.leo | 0 18 files changed, 53 insertions(+), 62 deletions(-) rename compiler/src/{prelude => deprecated}/blake2s.rs (100%) rename tests/{compiler/stdlib/packages/unstable => deprecated}/_blake2s/arguments_length_fail.leo (100%) rename tests/{compiler/stdlib/packages/unstable => deprecated}/_blake2s/arguments_type_fail.leo (100%) rename tests/{compiler/stdlib/packages/unstable => deprecated}/_blake2s/blake2s_input.leo (100%) rename tests/{compiler/stdlib/packages/unstable => deprecated}/_blake2s/blake2s_random.leo (100%) rename tests/{compiler/stdlib/packages/unstable => deprecated}/_blake2s/inputs/valid_input.in (100%) rename tests/{compiler/stdlib/packages/unstable => deprecated}/_blake2s/mod.rs (100%) rename tests/{compiler/stdlib/packages/unstable => deprecated}/_blake2s/outputs/valid_output.out (100%) rename tests/{compiler/stdlib => deprecated}/blake2s.leo (100%) rename tests/{compiler/stdlib => deprecated}/core_circuit_invalid.leo (100%) rename tests/{expectations/compiler/compiler/stdlib => deprecated}/core_circuit_invalid.leo.out (100%) rename tests/{compiler/definition => deprecated}/out_of_order_with_import.leo (100%) rename tests/{expectations/compiler/compiler/definition => deprecated}/out_of_order_with_import.leo.out (100%) rename tests/{compiler/stdlib => deprecated}/unstable_blake2s.leo (100%) diff --git a/.github/workflows/wasm.yml b/.github/workflows/wasm.yml index 19ae5d92ff..56fea4a90c 100644 --- a/.github/workflows/wasm.yml +++ b/.github/workflows/wasm.yml @@ -1,39 +1,39 @@ -#name: WASM -#on: -# pull_request: -# push: -# branches: -# - master -# - staging -# - trying -# paths-ignore: -# - 'docs/**' -# - 'documentation/**' -#env: -# RUST_BACKTRACE: 1 -# -#jobs: -# test-wasm-parser: -# name: Test on ${{ matrix.os }} -# runs-on: ${{ matrix.os }} -# defaults: -# run: -# working-directory: wasm -# strategy: -# matrix: -# os: [windows-latest] -# steps: -# - name: Checkout -# uses: actions/checkout@v2 -# - name: Install Rust Stable -# uses: actions-rs/toolchain@v1 -# with: -# profile: minimal -# toolchain: stable -# override: true -# - name: Install wasm-pack -# run: cargo install wasm-pack -# - name: Run wasm-pack -# run: wasm-pack build --dev --target nodejs -# - name: Install dependencies and run tests -# run: cd tests && npm ci && npm test +name: WASM +on: + pull_request: + push: + branches: + - master + - staging + - trying + paths-ignore: + - 'docs/**' + - 'documentation/**' +env: + RUST_BACKTRACE: 1 + +jobs: + test-wasm-parser: + name: Test on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + defaults: + run: + working-directory: wasm + strategy: + matrix: + os: [windows-latest] + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Install Rust Stable + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + - name: Install wasm-pack + run: cargo install wasm-pack + - name: Run wasm-pack + run: wasm-pack build --dev --target nodejs + - name: Install dependencies and run tests + run: cd tests && npm ci && npm test diff --git a/compiler/src/prelude/blake2s.rs b/compiler/src/deprecated/blake2s.rs similarity index 100% rename from compiler/src/prelude/blake2s.rs rename to compiler/src/deprecated/blake2s.rs diff --git a/compiler/src/expression/expression.rs b/compiler/src/expression/expression.rs index 79ba64101e..c9be0b60cd 100644 --- a/compiler/src/expression/expression.rs +++ b/compiler/src/expression/expression.rs @@ -179,27 +179,18 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { // Functions Expression::Call(CallExpression { - // function, - // target, - // arguments, + function, + target, + arguments, .. }) => { - unimplemented!("core circuits are not supported yet") - // if let Some(circuit) = function.get().circuit.get() { - // let core_mapping = circuit.core_mapping.borrow(); - // if let Some(core_mapping) = core_mapping.as_deref() { - // let core_circuit = resolve_core_circuit::(core_mapping); - // return self.enforce_core_circuit_call_expression( - // cs, - // &core_circuit, - // function.get(), - // target.get(), - // &arguments[..], - // span, - // ); - // } - // } - // self.enforce_function_call_expression(cs, function.get(), target.get(), &arguments[..], span) + if let Some(circuit) = function.get().circuit.get() { + let core_mapping = circuit.core_mapping.borrow(); + if let Some(core_mapping) = core_mapping.as_deref() { + unimplemented!("core circuits are not supported yet {}", core_mapping) + } + } + self.enforce_function_call_expression(cs, function.get(), target.get(), &arguments[..], span) } } } diff --git a/compiler/src/prelude/mod.rs b/compiler/src/prelude/mod.rs index 615600f2f5..810fa1d788 100644 --- a/compiler/src/prelude/mod.rs +++ b/compiler/src/prelude/mod.rs @@ -14,9 +14,6 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -// pub mod blake2s; -// pub use blake2s::*; - use crate::{ConstrainedValue, GroupType}; use leo_asg::Function; use leo_errors::{Result, Span}; diff --git a/stdlib/README.md b/stdlib/README.md index f46d01071b..6a8df615f3 100644 --- a/stdlib/README.md +++ b/stdlib/README.md @@ -26,4 +26,7 @@ function main() { The above type alias is auto imported from `stdlib/prelude/string.leo`. -The other directories must have explicit imports. For example, the unstable Blake2s can be imported with `import std.unstable.blake2s.Blake2s`. Which imports the `Blake2s` circuit defined in `stdlib/unstable/blake2s.leo`. +The other directories must have explicit imports. + +[//]: # (For example, the unstable Blake2s can be imported with `import std.unstable.blake2s.Blake2s`. Which imports the `Blake2s` circuit defined in `stdlib/unstable/blake2s.leo`.) + diff --git a/tests/compiler/stdlib/packages/unstable/_blake2s/arguments_length_fail.leo b/tests/deprecated/_blake2s/arguments_length_fail.leo similarity index 100% rename from tests/compiler/stdlib/packages/unstable/_blake2s/arguments_length_fail.leo rename to tests/deprecated/_blake2s/arguments_length_fail.leo diff --git a/tests/compiler/stdlib/packages/unstable/_blake2s/arguments_type_fail.leo b/tests/deprecated/_blake2s/arguments_type_fail.leo similarity index 100% rename from tests/compiler/stdlib/packages/unstable/_blake2s/arguments_type_fail.leo rename to tests/deprecated/_blake2s/arguments_type_fail.leo diff --git a/tests/compiler/stdlib/packages/unstable/_blake2s/blake2s_input.leo b/tests/deprecated/_blake2s/blake2s_input.leo similarity index 100% rename from tests/compiler/stdlib/packages/unstable/_blake2s/blake2s_input.leo rename to tests/deprecated/_blake2s/blake2s_input.leo diff --git a/tests/compiler/stdlib/packages/unstable/_blake2s/blake2s_random.leo b/tests/deprecated/_blake2s/blake2s_random.leo similarity index 100% rename from tests/compiler/stdlib/packages/unstable/_blake2s/blake2s_random.leo rename to tests/deprecated/_blake2s/blake2s_random.leo diff --git a/tests/compiler/stdlib/packages/unstable/_blake2s/inputs/valid_input.in b/tests/deprecated/_blake2s/inputs/valid_input.in similarity index 100% rename from tests/compiler/stdlib/packages/unstable/_blake2s/inputs/valid_input.in rename to tests/deprecated/_blake2s/inputs/valid_input.in diff --git a/tests/compiler/stdlib/packages/unstable/_blake2s/mod.rs b/tests/deprecated/_blake2s/mod.rs similarity index 100% rename from tests/compiler/stdlib/packages/unstable/_blake2s/mod.rs rename to tests/deprecated/_blake2s/mod.rs diff --git a/tests/compiler/stdlib/packages/unstable/_blake2s/outputs/valid_output.out b/tests/deprecated/_blake2s/outputs/valid_output.out similarity index 100% rename from tests/compiler/stdlib/packages/unstable/_blake2s/outputs/valid_output.out rename to tests/deprecated/_blake2s/outputs/valid_output.out diff --git a/tests/compiler/stdlib/blake2s.leo b/tests/deprecated/blake2s.leo similarity index 100% rename from tests/compiler/stdlib/blake2s.leo rename to tests/deprecated/blake2s.leo diff --git a/tests/compiler/stdlib/core_circuit_invalid.leo b/tests/deprecated/core_circuit_invalid.leo similarity index 100% rename from tests/compiler/stdlib/core_circuit_invalid.leo rename to tests/deprecated/core_circuit_invalid.leo diff --git a/tests/expectations/compiler/compiler/stdlib/core_circuit_invalid.leo.out b/tests/deprecated/core_circuit_invalid.leo.out similarity index 100% rename from tests/expectations/compiler/compiler/stdlib/core_circuit_invalid.leo.out rename to tests/deprecated/core_circuit_invalid.leo.out diff --git a/tests/compiler/definition/out_of_order_with_import.leo b/tests/deprecated/out_of_order_with_import.leo similarity index 100% rename from tests/compiler/definition/out_of_order_with_import.leo rename to tests/deprecated/out_of_order_with_import.leo diff --git a/tests/expectations/compiler/compiler/definition/out_of_order_with_import.leo.out b/tests/deprecated/out_of_order_with_import.leo.out similarity index 100% rename from tests/expectations/compiler/compiler/definition/out_of_order_with_import.leo.out rename to tests/deprecated/out_of_order_with_import.leo.out diff --git a/tests/compiler/stdlib/unstable_blake2s.leo b/tests/deprecated/unstable_blake2s.leo similarity index 100% rename from tests/compiler/stdlib/unstable_blake2s.leo rename to tests/deprecated/unstable_blake2s.leo From 22b16a0bcb3870f6fead39da184d5dfb170e2314 Mon Sep 17 00:00:00 2001 From: collin <16715212+collinc97@users.noreply.github.com> Date: Tue, 25 Jan 2022 16:17:36 -0800 Subject: [PATCH 3/3] regenerate all tests --- tests/compiler/address/equal.leo | 2 +- tests/compiler/address/inputs/address1.in | 2 +- tests/compiler/address/inputs/address2.in | 2 +- tests/compiler/address/inputs/branch.in | 2 +- tests/compiler/address/ternary.leo | 4 +- .../input/token_withdraw.state | 2 +- .../input_files/program_state/access_all.leo | 2 +- .../program_state/input/token_withdraw.state | 2 +- .../_blake2s/arguments_length_fail.leo | 9 -- .../_blake2s/arguments_type_fail.leo | 10 -- tests/deprecated/_blake2s/blake2s_input.leo | 5 - tests/deprecated/_blake2s/blake2s_random.leo | 7 -- .../deprecated/_blake2s/inputs/valid_input.in | 6 - tests/deprecated/_blake2s/mod.rs | 106 ------------------ .../_blake2s/outputs/valid_output.out | 2 - tests/deprecated/blake2s.leo | 10 -- tests/deprecated/core_circuit_invalid.leo | 8 -- tests/deprecated/core_circuit_invalid.leo.out | 5 - tests/deprecated/out_of_order_with_import.leo | 17 --- .../out_of_order_with_import.leo.out | 22 ---- tests/deprecated/unstable_blake2s.leo | 20 ---- .../compiler/compiler/address/equal.leo.out | 8 +- .../compiler/compiler/address/ternary.leo.out | 8 +- .../array_without_size/type_alias.leo.out | 10 +- .../compiler/compiler/char/circuit.leo.out | 8 +- .../compiler/compiler/char/neq.leo.out | 10 +- .../compiler/char/nonprinting.leo.out | 8 +- .../compiler/compiler/char/out.leo.out | 8 +- .../compiler/compiler/field/field.leo.out | 8 +- .../tests/import_dependency_folder.leo.out | 10 +- .../compiler/import_local/import_as.leo.out | 10 +- .../compiler/import_local/import_dir.leo.out | 10 +- .../import_local/import_files.leo.out | 10 +- .../program_input/main_char.leo.out | 8 +- .../program_input/main_string.leo.out | 8 +- .../program_input_constants/main_char.leo.out | 10 +- .../main_field.leo.out | 10 +- .../main_string.leo.out | 10 +- .../program_state/access_all.leo.out | 8 +- .../compiler/compiler/string/circuit.leo.out | 8 +- .../compiler/compiler/string/equality.leo.out | 10 +- .../compiler/compiler/string/replace.leo.out | 8 +- .../string/string_transformation.leo.out | 10 +- .../parser/expression/literal/address.leo.out | 2 +- .../expression/literal/address_parse.leo.out | 4 +- tests/parser/expression/literal/address.leo | 2 +- .../expression/literal/address_parse.leo | 2 +- 47 files changed, 113 insertions(+), 340 deletions(-) delete mode 100644 tests/deprecated/_blake2s/arguments_length_fail.leo delete mode 100644 tests/deprecated/_blake2s/arguments_type_fail.leo delete mode 100644 tests/deprecated/_blake2s/blake2s_input.leo delete mode 100644 tests/deprecated/_blake2s/blake2s_random.leo delete mode 100644 tests/deprecated/_blake2s/inputs/valid_input.in delete mode 100644 tests/deprecated/_blake2s/mod.rs delete mode 100644 tests/deprecated/_blake2s/outputs/valid_output.out delete mode 100644 tests/deprecated/blake2s.leo delete mode 100644 tests/deprecated/core_circuit_invalid.leo delete mode 100644 tests/deprecated/core_circuit_invalid.leo.out delete mode 100644 tests/deprecated/out_of_order_with_import.leo delete mode 100644 tests/deprecated/out_of_order_with_import.leo.out delete mode 100644 tests/deprecated/unstable_blake2s.leo diff --git a/tests/compiler/address/equal.leo b/tests/compiler/address/equal.leo index 35127e4cb9..e5bf5aee78 100644 --- a/tests/compiler/address/equal.leo +++ b/tests/compiler/address/equal.leo @@ -7,7 +7,7 @@ input_file: */ function main(x: address) -> bool { - const sender = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; + const sender = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8s7pyjh9; return x == sender; } diff --git a/tests/compiler/address/inputs/address1.in b/tests/compiler/address/inputs/address1.in index 1f1fd1870c..6c5627f86b 100644 --- a/tests/compiler/address/inputs/address1.in +++ b/tests/compiler/address/inputs/address1.in @@ -1,5 +1,5 @@ [main] -x: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; +x: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8s7pyjh9; [registers] a: bool = false; \ No newline at end of file diff --git a/tests/compiler/address/inputs/address2.in b/tests/compiler/address/inputs/address2.in index 8ee7606602..5bce1803f9 100644 --- a/tests/compiler/address/inputs/address2.in +++ b/tests/compiler/address/inputs/address2.in @@ -1,5 +1,5 @@ [main] -x: address = aleo18qgam03qe483tdrcc3fkqwpp38ehff4a2xma6lu7hams6lfpgcpq3dq05r; +x: address = aleo18qgam03qe483tdrcc3fkqwpp38ehff4a2xma6lu7hams6lfpgcpqy3sr3p; [registers] a: bool = false; \ No newline at end of file diff --git a/tests/compiler/address/inputs/branch.in b/tests/compiler/address/inputs/branch.in index 24e6b338e0..e09654befb 100644 --- a/tests/compiler/address/inputs/branch.in +++ b/tests/compiler/address/inputs/branch.in @@ -1,5 +1,5 @@ [main] -x: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; +x: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8s7pyjh9; y: bool = true; [registers] diff --git a/tests/compiler/address/ternary.leo b/tests/compiler/address/ternary.leo index 9f863b7450..82ef28725e 100644 --- a/tests/compiler/address/ternary.leo +++ b/tests/compiler/address/ternary.leo @@ -7,8 +7,8 @@ input_file: */ function main(x: address) -> bool { - const sender = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; - const receiver = aleo18qgam03qe483tdrcc3fkqwpp38ehff4a2xma6lu7hams6lfpgcpq3dq05r; + const sender = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8s7pyjh9; + const receiver = aleo18qgam03qe483tdrcc3fkqwpp38ehff4a2xma6lu7hams6lfpgcpqy3sr3p; return x == sender ? receiver == x : sender == x; } \ No newline at end of file diff --git a/tests/compiler/input_files/program_input_and_program_state/input/token_withdraw.state b/tests/compiler/input_files/program_input_and_program_state/input/token_withdraw.state index 71f115d4d9..4de7ba1328 100644 --- a/tests/compiler/input_files/program_input_and_program_state/input/token_withdraw.state +++ b/tests/compiler/input_files/program_input_and_program_state/input/token_withdraw.state @@ -9,7 +9,7 @@ root: [u8; 32] = [0u8; 32]; [record] serial_number: [u8; 32] = [0u8; 32]; commitment: [u8; 32] = [0u8; 32]; -owner: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; +owner: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8s7pyjh9; value: u64 = 5; payload: [u8; 32] = [0u8; 32]; birth_program_id: [u8; 32] = [0u8; 32]; diff --git a/tests/compiler/input_files/program_state/access_all.leo b/tests/compiler/input_files/program_state/access_all.leo index 1f830228b6..1810992033 100644 --- a/tests/compiler/input_files/program_state/access_all.leo +++ b/tests/compiler/input_files/program_state/access_all.leo @@ -6,7 +6,7 @@ input_file: input/dummy.in */ function main() -> bool { - const expected: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; + const expected: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8s7pyjh9; return input.state.root == [0u8; 32] && input.state_leaf.network_id == 0u8; diff --git a/tests/compiler/input_files/program_state/input/token_withdraw.state b/tests/compiler/input_files/program_state/input/token_withdraw.state index 219fc44776..21e245b864 100644 --- a/tests/compiler/input_files/program_state/input/token_withdraw.state +++ b/tests/compiler/input_files/program_state/input/token_withdraw.state @@ -9,7 +9,7 @@ root: [u8; 32] = [0u8; 32]; [record] serial_number: [u8; 32] = [0u8; 32]; commitment: [u8; 32] = [0u8; 32]; -owner: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; +owner: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8s7pyjh9; value: u64 = 5; payload: [u8; 32] = [0u8; 32]; birth_program_id: [u8; 32] = [0u8; 32]; diff --git a/tests/deprecated/_blake2s/arguments_length_fail.leo b/tests/deprecated/_blake2s/arguments_length_fail.leo deleted file mode 100644 index 614490432d..0000000000 --- a/tests/deprecated/_blake2s/arguments_length_fail.leo +++ /dev/null @@ -1,9 +0,0 @@ -import core.unstable.blake2s.Blake2s; - -function main() { - const seed: [u8; 32] = [0; 32]; - - const result = Blake2s::hash(seed); // function `hash` takes 2 arguments - - console.log("Result: {}", result); -} diff --git a/tests/deprecated/_blake2s/arguments_type_fail.leo b/tests/deprecated/_blake2s/arguments_type_fail.leo deleted file mode 100644 index f80e7b0205..0000000000 --- a/tests/deprecated/_blake2s/arguments_type_fail.leo +++ /dev/null @@ -1,10 +0,0 @@ -import core.unstable.blake2s.Blake2s; - -function main() { - const seed: [u8; 32] = [0; 32]; - const message: [u16; 32] = [0; 32]; // message should be type [u8; 32] - - const result = Blake2s::hash(seed, message); - - console.log("Result: {}", result); -} diff --git a/tests/deprecated/_blake2s/blake2s_input.leo b/tests/deprecated/_blake2s/blake2s_input.leo deleted file mode 100644 index 51de777341..0000000000 --- a/tests/deprecated/_blake2s/blake2s_input.leo +++ /dev/null @@ -1,5 +0,0 @@ -import core.unstable.blake2s.Blake2s; - -function main(seed: [u8; 32], message: [u8; 32]) -> [u8; 32] { - return Blake2s::hash(seed, message); -} diff --git a/tests/deprecated/_blake2s/blake2s_random.leo b/tests/deprecated/_blake2s/blake2s_random.leo deleted file mode 100644 index c9592fcbf8..0000000000 --- a/tests/deprecated/_blake2s/blake2s_random.leo +++ /dev/null @@ -1,7 +0,0 @@ -import core.unstable.blake2s.Blake2s; - -function main(seed: [u8; 32], message: [u8; 32], expected: [u8; 32]) { - const actual = Blake2s::hash(seed, message); - - console.assert(expected == actual); -} diff --git a/tests/deprecated/_blake2s/inputs/valid_input.in b/tests/deprecated/_blake2s/inputs/valid_input.in deleted file mode 100644 index 6f5064f41d..0000000000 --- a/tests/deprecated/_blake2s/inputs/valid_input.in +++ /dev/null @@ -1,6 +0,0 @@ -[main] -seed: [u8; 32] = [0; 32]; -message: [u8; 32] = [0; 32]; - -[registers] -r0: [u8; 32] = [0; 32]; \ No newline at end of file diff --git a/tests/deprecated/_blake2s/mod.rs b/tests/deprecated/_blake2s/mod.rs deleted file mode 100644 index ce9a23b2f3..0000000000 --- a/tests/deprecated/_blake2s/mod.rs +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::{ - assert_satisfied, - expect_asg_error, - generate_main_input, - get_output, - parse_program, - parse_program_with_input, -}; - -use leo_ast::InputValue; -use leo_input::types::{IntegerType, U8Type, UnsignedIntegerType}; -use rand::Rng; -use rand_core::SeedableRng; -use rand_xorshift::XorShiftRng; -use snarkvm_algorithms::{prf::blake2s::Blake2s as B2SPRF, traits::PRF}; - -#[test] -fn test_arguments_length_fail() { - let program_string = include_str!("arguments_length_fail.leo"); - let error = parse_program(program_string).err().unwrap(); - - expect_asg_error(error); -} - -#[test] -fn test_arguments_type_fail() { - let program_string = include_str!("arguments_type_fail.leo"); - let error = parse_program(program_string).err().unwrap(); - - expect_asg_error(error); -} - -#[test] -fn test_blake2s_input() { - let input_string = include_str!("inputs/valid_input.in"); - let program_string = include_str!("blake2s_input.leo"); - let expected_string = include_str!("outputs/valid_output.out"); - - let program = parse_program_with_input(program_string, input_string).unwrap(); - - let actual_bytes = get_output(program); - let actual_string = std::str::from_utf8(actual_bytes.bytes().as_slice()).unwrap(); - - assert_eq!(expected_string, actual_string) -} - -#[test] -fn test_blake2s_random() { - let mut rng = XorShiftRng::seed_from_u64(1231275789u64); - - let mut seed = [0u8; 32]; - rng.fill(&mut seed); - - let mut message = [0u8; 32]; - rng.fill(&mut message); - - // Use snarkvm-algorithms blake2s evaluate to get expected value - let expected = B2SPRF::evaluate(&seed, &message).unwrap().to_vec(); - - // Create program input values for seed, message, and expected values - let seed_input_value = bytes_gadget_to_input(seed.to_vec()); - let message_input_value = bytes_gadget_to_input(message.to_vec()); - let expected_value = bytes_gadget_to_input(expected); - - // The `blake2s_random.leo` program will compute a blake2s hash digest and compare it against - // the expected value - let bytes = include_str!("blake2s_random.leo"); - let mut program = parse_program(bytes).unwrap(); - - let main_input = generate_main_input(vec![ - ("seed", Some(seed_input_value)), - ("message", Some(message_input_value)), - ("expected", Some(expected_value)), - ]); - - // Load input values into Leo program - program.set_main_input(main_input); - - assert_satisfied(program); -} - -fn bytes_gadget_to_input(bytes: Vec) -> InputValue { - let u8_type = IntegerType::Unsigned(UnsignedIntegerType::U8Type(U8Type {})); - let bytes = bytes - .into_iter() - .map(|byte| InputValue::Integer(u8_type.clone(), byte.to_string())) - .collect::>(); - - InputValue::Array(bytes) -} diff --git a/tests/deprecated/_blake2s/outputs/valid_output.out b/tests/deprecated/_blake2s/outputs/valid_output.out deleted file mode 100644 index f8f60f3e4e..0000000000 --- a/tests/deprecated/_blake2s/outputs/valid_output.out +++ /dev/null @@ -1,2 +0,0 @@ -[registers] -r0: [u8; 32] = [174, 9, 219, 124, 213, 79, 66, 180, 144, 239, 9, 182, 188, 84, 26, 246, 136, 228, 149, 155, 184, 197, 63, 53, 154, 111, 86, 227, 138, 180, 84, 163]; diff --git a/tests/deprecated/blake2s.leo b/tests/deprecated/blake2s.leo deleted file mode 100644 index ca313661a6..0000000000 --- a/tests/deprecated/blake2s.leo +++ /dev/null @@ -1,10 +0,0 @@ -// namespace: Compile -// expectation: Fail -// input_files: -// - input/dummy.in - -import std.unstable.blake2s.BadCircuit; // `BadCircuit` is not included in the blake2s package - -function main() -> bool { - return false; -} diff --git a/tests/deprecated/core_circuit_invalid.leo b/tests/deprecated/core_circuit_invalid.leo deleted file mode 100644 index a98b491050..0000000000 --- a/tests/deprecated/core_circuit_invalid.leo +++ /dev/null @@ -1,8 +0,0 @@ -/* -namespace: Compile -expectation: Fail -*/ - -import std.unstable.blake2s.BadCircuit; // `BadCircuit` is not included in the blake2s package - -function main() {} diff --git a/tests/deprecated/core_circuit_invalid.leo.out b/tests/deprecated/core_circuit_invalid.leo.out deleted file mode 100644 index ddf8c56ae5..0000000000 --- a/tests/deprecated/core_circuit_invalid.leo.out +++ /dev/null @@ -1,5 +0,0 @@ ---- -namespace: Compile -expectation: Fail -outputs: - - "Error [EASG0373043]: failed to resolve import: 'std.unstable.blake2s'\n --> compiler-test:3:29\n |\n 3 | import std.unstable.blake2s.BadCircuit; // `BadCircuit` is not included in the blake2s package\n | ^^^^^^^^^^" diff --git a/tests/deprecated/out_of_order_with_import.leo b/tests/deprecated/out_of_order_with_import.leo deleted file mode 100644 index 33aa621c8d..0000000000 --- a/tests/deprecated/out_of_order_with_import.leo +++ /dev/null @@ -1,17 +0,0 @@ -/* -namespace: Compile -expectation: Pass -input_file: input/dummy.in -*/ - -@test -function fake_test() {} - -function main(y: bool) -> bool { - return y == true; -} - -// use std import to test import order -import std.unstable.blake2s.Blake2s; - -circuit Foo {} diff --git a/tests/deprecated/out_of_order_with_import.leo.out b/tests/deprecated/out_of_order_with_import.leo.out deleted file mode 100644 index 5f3a1d4836..0000000000 --- a/tests/deprecated/out_of_order_with_import.leo.out +++ /dev/null @@ -1,22 +0,0 @@ ---- -namespace: Compile -expectation: Pass -outputs: - - circuit: - num_public_variables: 0 - num_private_variables: 1 - num_constraints: 1 - at: 042610d0fd1fe6d6ac112138f8755752f44c7d2a00f1b5960574d6da5cda393f - bt: e97756698880ab7555a959a5fb5c6b4e15bd64612aa677adbfe2d0bd91f0a83c - ct: cf1cbb66a638b4860a516671fb74850e6ccf787fe6c4c8d29e9c04efe880bd05 - output: - - input_file: input/dummy.in - output: - registers: - r0: - type: bool - value: "true" - initial_ast: 0a138834560939331de0f995568c88c6f302f6b6a618b15853a7733f3a27a5fa - imports_resolved_ast: bbe044d26292750336f98faa3d4bc1f7df32d05ecd0d0a091e61ff35bcc2e8c0 - canonicalized_ast: 4d2aa13307150ece9e276f7a7e9f7481a2b97a4ef2a15428cc47dab9b8c8542f - type_inferenced_ast: 7af45b2a238bea3f011aacb586db9d75b691ce9e1c9698c054ca7c41cdd0b40e diff --git a/tests/deprecated/unstable_blake2s.leo b/tests/deprecated/unstable_blake2s.leo deleted file mode 100644 index 7526c3ee45..0000000000 --- a/tests/deprecated/unstable_blake2s.leo +++ /dev/null @@ -1,20 +0,0 @@ -// namespace: Compile -// expectation: Pass -// inputs: -// - blake.in: | -// [main] -// message: [u8; 32] = [0; 32]; - -// [registers] -// r0: [u8; 32] = [0; 32]; - -import std.unstable.blake2s.Blake2s; - -function main(message: [u8; 32]) -> [u8; 32] { - const seed: [u8; 32] = [1; 32]; - let result = Blake2s::hash(seed, message); - - console.log("Result: {}", result); - - return result; -} diff --git a/tests/expectations/compiler/compiler/address/equal.leo.out b/tests/expectations/compiler/compiler/address/equal.leo.out index 29af3681c7..eb3bcfb75d 100644 --- a/tests/expectations/compiler/compiler/address/equal.leo.out +++ b/tests/expectations/compiler/compiler/address/equal.leo.out @@ -22,7 +22,7 @@ outputs: a: type: bool value: "false" - initial_ast: 86c87f7c1bda6448d831106aab9bd29a5cb80082503fc7851aac9289d4c355f2 - imports_resolved_ast: 93751be8c7c9e9d42efdb046b34260713dd0c12667577e631a1d320674cc0ed9 - canonicalized_ast: 93751be8c7c9e9d42efdb046b34260713dd0c12667577e631a1d320674cc0ed9 - type_inferenced_ast: 7f22803c150b89187566309e1581f120d8ba838ce1c3a403a98cd6ad71ba08b4 + initial_ast: d30da3fdf0dd78daaa3e9c9205d4b0586e1b7ac260bb7ffd8e2d4987bfa9abaf + imports_resolved_ast: e92ad6367f56037fc168702523540baf869e2c5b089812a08e2e230ba45c40b4 + canonicalized_ast: e92ad6367f56037fc168702523540baf869e2c5b089812a08e2e230ba45c40b4 + type_inferenced_ast: 3dab0722613f664942053774b68d600d51ebaef77d30e166f707c5ce88749443 diff --git a/tests/expectations/compiler/compiler/address/ternary.leo.out b/tests/expectations/compiler/compiler/address/ternary.leo.out index f5bdb322ae..54fad5e547 100644 --- a/tests/expectations/compiler/compiler/address/ternary.leo.out +++ b/tests/expectations/compiler/compiler/address/ternary.leo.out @@ -22,7 +22,7 @@ outputs: a: type: bool value: "false" - initial_ast: dd955e706905ed892a0ae72d551f0bdf79711f1cc05c5becf5506e34ad104ead - imports_resolved_ast: 7125a2a8ab864e2d9019bfeed49d6450ba21123387ff5bff5b22bd0d679b7c4f - canonicalized_ast: 7125a2a8ab864e2d9019bfeed49d6450ba21123387ff5bff5b22bd0d679b7c4f - type_inferenced_ast: 35acf899be15516155477b449ea9443c1def435bdd2cb67e27ffa3c6a661465c + initial_ast: 85d3058b1d8ec4612bc789d7ac9bc49ec5d8edce42d3363eefe4de1a3808b44d + imports_resolved_ast: fe38e424a54f4d75e998fd43899428009a99f4f412eae9cd536ce3e22eace228 + canonicalized_ast: fe38e424a54f4d75e998fd43899428009a99f4f412eae9cd536ce3e22eace228 + type_inferenced_ast: ef12afa598976ebeda5e1c755f3b4f01ce74ecd72a46a8dda8bf7fe53c32a228 diff --git a/tests/expectations/compiler/compiler/array_without_size/type_alias.leo.out b/tests/expectations/compiler/compiler/array_without_size/type_alias.leo.out index 85acf0789c..26b0fda988 100644 --- a/tests/expectations/compiler/compiler/array_without_size/type_alias.leo.out +++ b/tests/expectations/compiler/compiler/array_without_size/type_alias.leo.out @@ -4,11 +4,11 @@ expectation: Pass outputs: - circuit: num_public_variables: 0 - num_private_variables: 1 - num_constraints: 1 - at: 042610d0fd1fe6d6ac112138f8755752f44c7d2a00f1b5960574d6da5cda393f - bt: e97756698880ab7555a959a5fb5c6b4e15bd64612aa677adbfe2d0bd91f0a83c - ct: cf1cbb66a638b4860a516671fb74850e6ccf787fe6c4c8d29e9c04efe880bd05 + num_private_variables: 4 + num_constraints: 5 + at: e2c343f33b3c986318d821645015951a2f3fb198915bbf602e2c3e58ebfb9c73 + bt: 71744948a918814d3008831b4b73101a5cf7346e6ff62d98968eb8b3b91aa343 + ct: 94757fb2316d68d18fd26e96a2992b03a8db8d49d802b34201dce6f12518676b output: - input_file: input/dummy.in output: diff --git a/tests/expectations/compiler/compiler/char/circuit.leo.out b/tests/expectations/compiler/compiler/char/circuit.leo.out index 9342f7ad0f..33b23ff4f4 100644 --- a/tests/expectations/compiler/compiler/char/circuit.leo.out +++ b/tests/expectations/compiler/compiler/char/circuit.leo.out @@ -4,11 +4,11 @@ expectation: Pass outputs: - circuit: num_public_variables: 0 - num_private_variables: 6 + num_private_variables: 4 num_constraints: 4 - at: 2859fe6f24016b5634df2791da7de932e68ec32c73b5b573e0c39e968c7a4e12 - bt: 8143508f19c8eee208a7fbbcfb833aeeace6ba0a761e41d028599d2237cc60fa - ct: d0c6feeed1e6b8d5c0e03dc9e25641b7fdc34ad912e2b1488296d4a99ed6cbf5 + at: 72e9944e2f10b25f4bd1044183a18e95242d3f008169ebbe2032b2b90a10b538 + bt: 0dfacddfe48e86dc68cb29c97752ad6524bcaea20b3aba07252117315c346c07 + ct: 7f6747978559a1a191dddd1fb06ba017f4cade269311a06e12843dec58a530fb output: - input_file: inputs/ascii.in output: diff --git a/tests/expectations/compiler/compiler/char/neq.leo.out b/tests/expectations/compiler/compiler/char/neq.leo.out index 73f1a04819..1bc4c7439e 100644 --- a/tests/expectations/compiler/compiler/char/neq.leo.out +++ b/tests/expectations/compiler/compiler/char/neq.leo.out @@ -4,11 +4,11 @@ expectation: Pass outputs: - circuit: num_public_variables: 0 - num_private_variables: 6 - num_constraints: 3 - at: cc1286e0b6fa2e90fb6f0880431a7c1e2cc37a329fae3aff1c13f51036c66f12 - bt: 02c492cb6df07172e56cffd0cfd902a8443921e1256a2d907bbabd30bf6b8f6d - ct: a1f8e2b168c0f2f28f0ca3f16ce9b25ba7f7c410cfd68b0912bf19c90b53f2a2 + num_private_variables: 4 + num_constraints: 4 + at: c0cf3dc518339e72fe702ee45ff8d77ccc007a2c7a91c08885236532043284f2 + bt: cadc466054742aac2e5ad12031ade45e16b84411bf2a19fabeac72374fa966f3 + ct: 6474e67439e74f7b4ad9e348a3103b26a7950df4ed8d13c571bb917061e142d2 output: - input_file: inputs/ascii.in output: diff --git a/tests/expectations/compiler/compiler/char/nonprinting.leo.out b/tests/expectations/compiler/compiler/char/nonprinting.leo.out index 7ebd0c6004..4ae185185c 100644 --- a/tests/expectations/compiler/compiler/char/nonprinting.leo.out +++ b/tests/expectations/compiler/compiler/char/nonprinting.leo.out @@ -4,11 +4,11 @@ expectation: Pass outputs: - circuit: num_public_variables: 0 - num_private_variables: 36 + num_private_variables: 35 num_constraints: 3 - at: 25579220a31118007fe071d3083ad5a5503f7dc6bd4d51abf15f1a7778a99c86 - bt: 8f5bf097224289e45b78e01a711900a993240585fe13744f9ab71a9c5c4d9111 - ct: df019f90846f94966d481bfb6d579bee9c47d281176e210ccd973210afc957a1 + at: 2cf8a8d414b04c4782c28eda28755a5030f61cf90645cce3de0e25d0a0ec662a + bt: 4727127f178bb02895a615bf38a4aa3c5cb9d2b076eca15ebe6fea741b48ce98 + ct: cae904ba23a045f4438177f10211a50ae29eee49d08211c731aee88353dc0cfb output: - input_file: inputs/nonprinting.in output: diff --git a/tests/expectations/compiler/compiler/char/out.leo.out b/tests/expectations/compiler/compiler/char/out.leo.out index 9350d3c353..e61941dff7 100644 --- a/tests/expectations/compiler/compiler/char/out.leo.out +++ b/tests/expectations/compiler/compiler/char/out.leo.out @@ -4,11 +4,11 @@ expectation: Pass outputs: - circuit: num_public_variables: 0 - num_private_variables: 6 + num_private_variables: 4 num_constraints: 4 - at: 2859fe6f24016b5634df2791da7de932e68ec32c73b5b573e0c39e968c7a4e12 - bt: 8143508f19c8eee208a7fbbcfb833aeeace6ba0a761e41d028599d2237cc60fa - ct: d0c6feeed1e6b8d5c0e03dc9e25641b7fdc34ad912e2b1488296d4a99ed6cbf5 + at: f16b951c655255bc312340c9a2cfcad1358207f9fdb897806e446a97ae0938fc + bt: e40c550e09a5732a365d626ccfffd7ee21fe92c50ac84f338000b8d3e4760a8f + ct: 7f6747978559a1a191dddd1fb06ba017f4cade269311a06e12843dec58a530fb output: - input_file: inputs/ascii.in output: diff --git a/tests/expectations/compiler/compiler/field/field.leo.out b/tests/expectations/compiler/compiler/field/field.leo.out index 78311d3666..2bbca103ed 100644 --- a/tests/expectations/compiler/compiler/field/field.leo.out +++ b/tests/expectations/compiler/compiler/field/field.leo.out @@ -4,11 +4,11 @@ expectation: Pass outputs: - circuit: num_public_variables: 0 - num_private_variables: 4 + num_private_variables: 3 num_constraints: 3 - at: cfcc3adf871aef0910034c4c3478746733a9746d44fd678971ee2e1e5e69dffd - bt: 02c492cb6df07172e56cffd0cfd902a8443921e1256a2d907bbabd30bf6b8f6d - ct: a1f8e2b168c0f2f28f0ca3f16ce9b25ba7f7c410cfd68b0912bf19c90b53f2a2 + at: 0b86cac5ba812f96b6db4b5ffdd1d8463fdaadd3fc8c3eaad8049aca72850ddf + bt: 96fe80788f9958c843626c6f725ffd743f3ada2504e3bd16be94746921689578 + ct: f1ede3ef5da6734d87d6254c41b53dd3e93b4b7a9e9b232f10d9525554fe16c6 output: - input_file: inputs/fields.in output: diff --git a/tests/expectations/compiler/compiler/import_dependency/tests/import_dependency_folder.leo.out b/tests/expectations/compiler/compiler/import_dependency/tests/import_dependency_folder.leo.out index ee628ccd2b..2502d4e965 100644 --- a/tests/expectations/compiler/compiler/import_dependency/tests/import_dependency_folder.leo.out +++ b/tests/expectations/compiler/compiler/import_dependency/tests/import_dependency_folder.leo.out @@ -4,11 +4,11 @@ expectation: Pass outputs: - circuit: num_public_variables: 0 - num_private_variables: 1 - num_constraints: 1 - at: 042610d0fd1fe6d6ac112138f8755752f44c7d2a00f1b5960574d6da5cda393f - bt: e97756698880ab7555a959a5fb5c6b4e15bd64612aa677adbfe2d0bd91f0a83c - ct: cf1cbb66a638b4860a516671fb74850e6ccf787fe6c4c8d29e9c04efe880bd05 + num_private_variables: 13 + num_constraints: 17 + at: cb933482c3e31654992014a6382c2d8c813651daddca53e2ddb30d62b4a7619b + bt: be851053d35028476633a81957d2f12dc4b49a7000c438c9b04708f6424bc27d + ct: d81046dae7b01d28a390bfa9f361de8410e930ce7d7e2eb1e8b5829c70a63606 output: - input_file: "../input/dummy.in" output: diff --git a/tests/expectations/compiler/compiler/import_local/import_as.leo.out b/tests/expectations/compiler/compiler/import_local/import_as.leo.out index 68390cae76..c512848449 100644 --- a/tests/expectations/compiler/compiler/import_local/import_as.leo.out +++ b/tests/expectations/compiler/compiler/import_local/import_as.leo.out @@ -4,11 +4,11 @@ expectation: Pass outputs: - circuit: num_public_variables: 0 - num_private_variables: 1 - num_constraints: 1 - at: 042610d0fd1fe6d6ac112138f8755752f44c7d2a00f1b5960574d6da5cda393f - bt: e97756698880ab7555a959a5fb5c6b4e15bd64612aa677adbfe2d0bd91f0a83c - ct: cf1cbb66a638b4860a516671fb74850e6ccf787fe6c4c8d29e9c04efe880bd05 + num_private_variables: 16 + num_constraints: 21 + at: 0596e617dbe43b233dda10a1544e765246a50ee01f81bba7264a3377e96d4288 + bt: 0193b379508e6b0285f1b2ac1fd13da47be59edfc12649d30b5399fbaa4c6f15 + ct: 6fe0be33f676f401130986b9c680508063812ac878a552cfedfdb9c13b1d5657 output: - input_file: input/dummy.in output: diff --git a/tests/expectations/compiler/compiler/import_local/import_dir.leo.out b/tests/expectations/compiler/compiler/import_local/import_dir.leo.out index 0cb9519aab..4321935cbc 100644 --- a/tests/expectations/compiler/compiler/import_local/import_dir.leo.out +++ b/tests/expectations/compiler/compiler/import_local/import_dir.leo.out @@ -4,11 +4,11 @@ expectation: Pass outputs: - circuit: num_public_variables: 0 - num_private_variables: 1 - num_constraints: 1 - at: 042610d0fd1fe6d6ac112138f8755752f44c7d2a00f1b5960574d6da5cda393f - bt: e97756698880ab7555a959a5fb5c6b4e15bd64612aa677adbfe2d0bd91f0a83c - ct: cf1cbb66a638b4860a516671fb74850e6ccf787fe6c4c8d29e9c04efe880bd05 + num_private_variables: 16 + num_constraints: 21 + at: 0596e617dbe43b233dda10a1544e765246a50ee01f81bba7264a3377e96d4288 + bt: 0193b379508e6b0285f1b2ac1fd13da47be59edfc12649d30b5399fbaa4c6f15 + ct: 6fe0be33f676f401130986b9c680508063812ac878a552cfedfdb9c13b1d5657 output: - input_file: input/dummy.in output: diff --git a/tests/expectations/compiler/compiler/import_local/import_files.leo.out b/tests/expectations/compiler/compiler/import_local/import_files.leo.out index 4db4be9df5..c4b42a245a 100644 --- a/tests/expectations/compiler/compiler/import_local/import_files.leo.out +++ b/tests/expectations/compiler/compiler/import_local/import_files.leo.out @@ -4,11 +4,11 @@ expectation: Pass outputs: - circuit: num_public_variables: 0 - num_private_variables: 1 - num_constraints: 1 - at: 042610d0fd1fe6d6ac112138f8755752f44c7d2a00f1b5960574d6da5cda393f - bt: e97756698880ab7555a959a5fb5c6b4e15bd64612aa677adbfe2d0bd91f0a83c - ct: cf1cbb66a638b4860a516671fb74850e6ccf787fe6c4c8d29e9c04efe880bd05 + num_private_variables: 16 + num_constraints: 21 + at: 0596e617dbe43b233dda10a1544e765246a50ee01f81bba7264a3377e96d4288 + bt: 0193b379508e6b0285f1b2ac1fd13da47be59edfc12649d30b5399fbaa4c6f15 + ct: 6fe0be33f676f401130986b9c680508063812ac878a552cfedfdb9c13b1d5657 output: - input_file: input/dummy.in output: diff --git a/tests/expectations/compiler/compiler/input_files/program_input/main_char.leo.out b/tests/expectations/compiler/compiler/input_files/program_input/main_char.leo.out index a05f7714f2..4c6a5d87cd 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input/main_char.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_input/main_char.leo.out @@ -4,11 +4,11 @@ expectation: Pass outputs: - circuit: num_public_variables: 0 - num_private_variables: 6 + num_private_variables: 5 num_constraints: 5 - at: a92e6894c8f239ebb17b299d1e49ef48d0c2a8690c56eb1362550ebeeb16a507 - bt: 8f725e0070f28462aac3db98a5282a9ffa8139f0103651a30df68d193419eacd - ct: 6d17d0577f11cb480fd832f84c38611e836e8aa93457407aa17c07c6ef9d3e03 + at: 61ed02a885cdcc6ab494fd4d7555ef341d9994042a3411e9f53802c5c227a56c + bt: 67b3d55750ec69d463afdcbd0e0b81b456c1db1e74b7eb440bea6a12cd95ef1c + ct: 710331a54de7f7067941b449874d60273de5adeb5553c02d0961217ae9c96feb output: - input_file: input/main_char.in output: diff --git a/tests/expectations/compiler/compiler/input_files/program_input/main_string.leo.out b/tests/expectations/compiler/compiler/input_files/program_input/main_string.leo.out index 091b486468..603812cbe6 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input/main_string.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_input/main_string.leo.out @@ -4,11 +4,11 @@ expectation: Pass outputs: - circuit: num_public_variables: 0 - num_private_variables: 26 + num_private_variables: 21 num_constraints: 21 - at: b4c72e270b0067ca380a70c8cb2632c33b17e7323b3817deb04e5fe72aa99c13 - bt: d476126ef8e9588f0ed444a75f025c1c468618ae84829d4d2deb37679e537563 - ct: 789b2eca89cbf96799b7c12eaa66df8efcec7fe1c6c8af5e741fe4955c5dee32 + at: 663ee8089acfe2db6dd027d9e700658ab895501529aed4bc1397ffcf9a3fca2c + bt: df7548a08c0c4f3105774500a41ea11a5620f93f8a2a0261970a144c70c7bf82 + ct: 86ecb87925d55af5887d73723e93e9aab55f9be4135284577f538471be99fd66 output: - input_file: input/main_string.in output: diff --git a/tests/expectations/compiler/compiler/input_files/program_input_constants/main_char.leo.out b/tests/expectations/compiler/compiler/input_files/program_input_constants/main_char.leo.out index 8692d070fc..0c888717fa 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input_constants/main_char.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_input_constants/main_char.leo.out @@ -4,11 +4,11 @@ expectation: Pass outputs: - circuit: num_public_variables: 0 - num_private_variables: 1 - num_constraints: 1 - at: 042610d0fd1fe6d6ac112138f8755752f44c7d2a00f1b5960574d6da5cda393f - bt: e97756698880ab7555a959a5fb5c6b4e15bd64612aa677adbfe2d0bd91f0a83c - ct: cf1cbb66a638b4860a516671fb74850e6ccf787fe6c4c8d29e9c04efe880bd05 + num_private_variables: 4 + num_constraints: 5 + at: bcd741045bd0827485e0bda207f770fde24029a6800bd1251a633819577c0469 + bt: 6d3a525cf2df60aa6d24cdfc442b4d97ee54b70d2c685ff8d0dc01201f53fab7 + ct: 0cbdac23e63505aa9f74483b5fff133d1f9f976417e6370626514df04711d802 output: - input_file: input/main_char.in output: diff --git a/tests/expectations/compiler/compiler/input_files/program_input_constants/main_field.leo.out b/tests/expectations/compiler/compiler/input_files/program_input_constants/main_field.leo.out index 0aaa6d7c56..781f7807d2 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input_constants/main_field.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_input_constants/main_field.leo.out @@ -4,11 +4,11 @@ expectation: Pass outputs: - circuit: num_public_variables: 0 - num_private_variables: 1 - num_constraints: 1 - at: 042610d0fd1fe6d6ac112138f8755752f44c7d2a00f1b5960574d6da5cda393f - bt: e97756698880ab7555a959a5fb5c6b4e15bd64612aa677adbfe2d0bd91f0a83c - ct: cf1cbb66a638b4860a516671fb74850e6ccf787fe6c4c8d29e9c04efe880bd05 + num_private_variables: 4 + num_constraints: 5 + at: 992d6f01cfca64e86db6fe2886e91e8f17a4adaf663a344190bfbeda791ee53d + bt: 6d3a525cf2df60aa6d24cdfc442b4d97ee54b70d2c685ff8d0dc01201f53fab7 + ct: 0cbdac23e63505aa9f74483b5fff133d1f9f976417e6370626514df04711d802 output: - input_file: input/main_field.in output: diff --git a/tests/expectations/compiler/compiler/input_files/program_input_constants/main_string.leo.out b/tests/expectations/compiler/compiler/input_files/program_input_constants/main_string.leo.out index 1e322fdd18..e4da663503 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input_constants/main_string.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_input_constants/main_string.leo.out @@ -4,11 +4,11 @@ expectation: Pass outputs: - circuit: num_public_variables: 0 - num_private_variables: 1 - num_constraints: 1 - at: 042610d0fd1fe6d6ac112138f8755752f44c7d2a00f1b5960574d6da5cda393f - bt: e97756698880ab7555a959a5fb5c6b4e15bd64612aa677adbfe2d0bd91f0a83c - ct: cf1cbb66a638b4860a516671fb74850e6ccf787fe6c4c8d29e9c04efe880bd05 + num_private_variables: 16 + num_constraints: 21 + at: ded17f08426a118004ed923a2b1c14303b54057004642678ad6145f3f80d2766 + bt: 0193b379508e6b0285f1b2ac1fd13da47be59edfc12649d30b5399fbaa4c6f15 + ct: a04ac0a4e55ea3a20c7b7a21825e6187c8fffd575983a0480931dcd0133cb093 output: - input_file: input/main_string.in output: diff --git a/tests/expectations/compiler/compiler/input_files/program_state/access_all.leo.out b/tests/expectations/compiler/compiler/input_files/program_state/access_all.leo.out index 07304dbdfc..776b2d2227 100644 --- a/tests/expectations/compiler/compiler/input_files/program_state/access_all.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_state/access_all.leo.out @@ -16,7 +16,7 @@ outputs: r0: type: bool value: "true" - initial_ast: 6e84f3b233f5e7b09595043093fb5ffabea7a646a8b64437312f1037b1a56f27 - imports_resolved_ast: 0be439776bf39f0452baf82acb272a458bf866f0f7a7a18646ff889a036fe312 - canonicalized_ast: 0be439776bf39f0452baf82acb272a458bf866f0f7a7a18646ff889a036fe312 - type_inferenced_ast: 2a72016db5bb95e48e128cfc48a257346c70baec5e24ed6ed607dd5015a76a38 + initial_ast: 8f368a56a1e3e33f68be7c6d269168941e8dcdee297d8972928493fd87f4d4ac + imports_resolved_ast: 474ee615cb97eba8bc03620fdfb4385f72a058ae80aefbb592c911251a7e8a9c + canonicalized_ast: 474ee615cb97eba8bc03620fdfb4385f72a058ae80aefbb592c911251a7e8a9c + type_inferenced_ast: 1139aae30b95a083600b409eb630af4fe2bc681cc91408061aaad8468af49ad6 diff --git a/tests/expectations/compiler/compiler/string/circuit.leo.out b/tests/expectations/compiler/compiler/string/circuit.leo.out index 36f984517f..2c4d620f7c 100644 --- a/tests/expectations/compiler/compiler/string/circuit.leo.out +++ b/tests/expectations/compiler/compiler/string/circuit.leo.out @@ -4,11 +4,11 @@ expectation: Pass outputs: - circuit: num_public_variables: 0 - num_private_variables: 141 + num_private_variables: 102 num_constraints: 115 - at: 145ada587c833434abb89c3349d19e06365fda3eb9b2a227046a78469e3ca313 - bt: f2945a3bc1beaee407bb4ec35303115a93a8c68886d97011cd65ec6d899664e8 - ct: 10b997b6341b3cf811cb7b0fdb891f91006d41c50e9f9566ff92f92816153dfc + at: 7453b98c12fac4b0d92a42f1e0c9b4dde2389fe55b0f836442e2a3502c32de52 + bt: 6a670bff54f76705dfbe30e7c1be7b28f0a974136f26885e1ceb455db16c1946 + ct: 291c1bf1dadfbb98cda72317e0fc46a0c83887b8f51684ed83eb16046a753b74 output: - input_file: inputs/string_out.in output: diff --git a/tests/expectations/compiler/compiler/string/equality.leo.out b/tests/expectations/compiler/compiler/string/equality.leo.out index c37acfbb29..2c07101e5d 100644 --- a/tests/expectations/compiler/compiler/string/equality.leo.out +++ b/tests/expectations/compiler/compiler/string/equality.leo.out @@ -4,11 +4,11 @@ expectation: Pass outputs: - circuit: num_public_variables: 0 - num_private_variables: 92 - num_constraints: 75 - at: c03384068dd2b9bd528c65e301960d5c4f61bf94949c9080f28a4bc57f81e856 - bt: 7f653d4004b13eee112bbefcf900b0c8201524129423cdda82799c18fdcfb3f7 - ct: bce0d8a64cf530613e693412358d17d231ec8516108ab4ee5a47ddf185a471fa + num_private_variables: 100 + num_constraints: 111 + at: 2bea97f00681ba26a4221c79dbc26d03370d5bc05c1e4ac07c3d883d7ac1a1a6 + bt: 0f000679bb7dbf9615c83e27ab044a6a8a1c759cea61976d5790d16e86c0eea8 + ct: 2c57adabbad7c0606a524438d632bdf3e71908909d55a3c761b7b1aba765a2a6 output: - input_file: inputs/string.in output: diff --git a/tests/expectations/compiler/compiler/string/replace.leo.out b/tests/expectations/compiler/compiler/string/replace.leo.out index 659b2e8945..5a8c5c7474 100644 --- a/tests/expectations/compiler/compiler/string/replace.leo.out +++ b/tests/expectations/compiler/compiler/string/replace.leo.out @@ -4,11 +4,11 @@ expectation: Pass outputs: - circuit: num_public_variables: 0 - num_private_variables: 68 + num_private_variables: 55 num_constraints: 51 - at: 45fa182371664010950da6ec3fa6360de34dda5cb814b3c8bd119a09e86b5c77 - bt: 4da3499799890924c2910625e052c6757e7cfd857ebbd18afd3d16b5bd0e9a73 - ct: 183c15a7bf0d7c109b082a55e696874797e7ce685096881ce803f6bfa453a875 + at: 7ba7304acc66e86feacd1df171eb534932ddf6f90b8a8d473ad06d0f01347ead + bt: bdc20c3f66291f136741364b66408a602e52e7531b1d6471d452d35e9916bb01 + ct: 7359ebc98ae471789569ce8733dcdab4c119c1ca5ca0f0bf063b0e984262324c output: - input_file: inputs/string.in output: diff --git a/tests/expectations/compiler/compiler/string/string_transformation.leo.out b/tests/expectations/compiler/compiler/string/string_transformation.leo.out index 4a0104af48..8a1068a2e0 100644 --- a/tests/expectations/compiler/compiler/string/string_transformation.leo.out +++ b/tests/expectations/compiler/compiler/string/string_transformation.leo.out @@ -4,11 +4,11 @@ expectation: Pass outputs: - circuit: num_public_variables: 0 - num_private_variables: 9 - num_constraints: 7 - at: 5f4cfa276f9e316a42c9292a4f149fcf3c301a4ca3dc14112b7d59e8ef1e002c - bt: c728f18e4b654023c5189f382573af92682099ed5c7c08e706604e6f1cb7d72d - ct: 74aca434b2a72f7215a0dbe138b708fb2c2857d95dc3bc4776903c90d5f47bb9 + num_private_variables: 43 + num_constraints: 55 + at: d7f6245e2e4353293dcefd52fb12195690a5d8fa9f53a6a7cb795c9f597848a5 + bt: 02fcee9bc7a015b4e5928d9190ef46d5b2cc0232a5a86c7a7f5b3ca6e8b5b00a + ct: 40109f1a0eabde6db1fd1d0f22fb417d1384218962d7d0cd88247e5dfdfcc124 output: - input_file: inputs/two.in output: diff --git a/tests/expectations/parser/parser/expression/literal/address.leo.out b/tests/expectations/parser/parser/expression/literal/address.leo.out index 04610e6ead..9b6b9d18c8 100644 --- a/tests/expectations/parser/parser/expression/literal/address.leo.out +++ b/tests/expectations/parser/parser/expression/literal/address.leo.out @@ -2,7 +2,7 @@ namespace: Token expectation: Pass outputs: - - "'aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8' @ 1:1-64" + - "'aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8s7pyjh9' @ 1:1-64" - "'aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j9' @ 1:1-64" - "'aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d9' @ 1:1-64" - "'aleo1aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8st' @ 1:1-64" diff --git a/tests/expectations/parser/parser/expression/literal/address_parse.leo.out b/tests/expectations/parser/parser/expression/literal/address_parse.leo.out index dcfa2e47b7..e1dcfd68bb 100644 --- a/tests/expectations/parser/parser/expression/literal/address_parse.leo.out +++ b/tests/expectations/parser/parser/expression/literal/address_parse.leo.out @@ -4,14 +4,14 @@ expectation: Pass outputs: - Value: Address: - - aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8 + - aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8s7pyjh9 - span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 64 path: "" - content: aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8 + content: aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8s7pyjh9 - Value: Address: - aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j9 diff --git a/tests/parser/expression/literal/address.leo b/tests/parser/expression/literal/address.leo index 137f8477a7..5d4ec9d0e9 100644 --- a/tests/parser/expression/literal/address.leo +++ b/tests/parser/expression/literal/address.leo @@ -2,7 +2,7 @@ namespace: Token expectation: Pass */ -aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8 +aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8s7pyjh9 aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j9 aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d9 aleo1aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8st diff --git a/tests/parser/expression/literal/address_parse.leo b/tests/parser/expression/literal/address_parse.leo index 4ffe7ccc60..c27485d084 100644 --- a/tests/parser/expression/literal/address_parse.leo +++ b/tests/parser/expression/literal/address_parse.leo @@ -3,7 +3,7 @@ namespace: ParseExpression expectation: Pass */ -aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8 +aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8s7pyjh9 aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j9 aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d9 aleo1aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8st