Regen expectations

This commit is contained in:
Pranav Gaddamadugu 2023-04-04 16:14:00 -07:00
parent da7537344b
commit 00a7943746
11 changed files with 27 additions and 72 deletions

View File

@ -1,11 +0,0 @@
---
namespace: Compile
expectation: Pass
outputs:
- - initial_ast: 6fa465e63f2b8e880d621cb1758b3d1c0edfa9ce09e6d4f0f28bbe6c2ca2b955
unrolled_ast: 6fa465e63f2b8e880d621cb1758b3d1c0edfa9ce09e6d4f0f28bbe6c2ca2b955
ssa_ast: 6fa465e63f2b8e880d621cb1758b3d1c0edfa9ce09e6d4f0f28bbe6c2ca2b955
flattened_ast: 4b8969d1adf68074bc7a8458a9146e128041bf929f2f6a4e76a16ad2769b81b1
inlined_ast: 4b8969d1adf68074bc7a8458a9146e128041bf929f2f6a4e76a16ad2769b81b1
dce_ast: 4b8969d1adf68074bc7a8458a9146e128041bf929f2f6a4e76a16ad2769b81b1
bytecode: 39aa8516297ece27331b633a72466d2ff0122d36beca663a48bc07589e2d3e15

View File

@ -1,5 +0,0 @@
---
namespace: Compile
expectation: Fail
outputs:
- "Error [ETYC0372007]: Expected one type from `Token`, but got `u128`\n --> compiler-test:18:33\n |\n 18 | decrement(tokens, addr, amount);\n | ^^^^^^\nError [ETYC0372007]: Expected one type from `address`, but got `u8`\n --> compiler-test:19:28\n |\n 19 | decrement(amounts, 1u8, amount);\n | ^^^\nError [ETYC0372007]: Expected one type from `u128`, but got `u8`\n --> compiler-test:20:34\n |\n 20 | decrement(amounts, addr, 1u8);\n | ^^^\nError [ETYC0372003]: Expected type `u64` but type `u8` was found\n --> compiler-test:21:61\n |\n 21 | decrement(tokens, addr, Token { owner: addr, gates: 1u8, amount: 1u8 });\n | ^^^\nError [ETYC0372003]: Expected type `u128` but type `u8` was found\n --> compiler-test:21:74\n |\n 21 | decrement(tokens, addr, Token { owner: addr, gates: 1u8, amount: 1u8 });\n | ^^^\nError [ETYC0372007]: Expected one type from `field, group, scalar, i8, i16, i32, i64, i128, u8, u16, u32, u64, u128`, but got `Token`\n --> compiler-test:21:33\n |\n 21 | decrement(tokens, addr, Token { owner: addr, gates: 1u8, amount: 1u8 });\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372005]: Unknown variable `foo`\n --> compiler-test:22:19\n |\n 22 | decrement(foo, addr, amount);\n | ^^^\nError [ETYC0372004]: Could not determine the type of `foo`\n --> compiler-test:22:19\n |\n 22 | decrement(foo, addr, amount);\n | ^^^\n"

View File

@ -2,4 +2,4 @@
namespace: Compile
expectation: Fail
outputs:
- "Error [ETYC0372005]: Unknown function `decrement`\n --> compiler-test:18:9\n |\n 18 | decrement(tokens, addr, amount);\n | ^^^^^^^^^\nError [ETYC0372005]: Unknown function `decrement`\n --> compiler-test:19:9\n |\n 19 | decrement(amounts, 1u8, amount);\n | ^^^^^^^^^\nError [ETYC0372005]: Unknown function `decrement`\n --> compiler-test:20:9\n |\n 20 | decrement(amounts, addr, 1u8);\n | ^^^^^^^^^\nError [ETYC0372005]: Unknown function `decrement`\n --> compiler-test:21:9\n |\n 21 | decrement(tokens, addr, Token { owner: addr, gates: 1u8, amount: 1u8 });\n | ^^^^^^^^^\nError [ETYC0372005]: Unknown function `decrement`\n --> compiler-test:22:9\n |\n 22 | decrement(foo, addr, amount);\n | ^^^^^^^^^\nWarning [WPAR0370001]: The keyword `decrement` is deprecated.\n --> compiler-test:18:9\n |\n 18 | decrement(tokens, addr, amount);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = Use `Mapping::{get, get_or, put}` for manipulating on-chain mappings.\nWarning [WPAR0370001]: The keyword `decrement` is deprecated.\n --> compiler-test:19:9\n |\n 19 | decrement(amounts, 1u8, amount);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = Use `Mapping::{get, get_or, put}` for manipulating on-chain mappings.\nWarning [WPAR0370001]: The keyword `decrement` is deprecated.\n --> compiler-test:20:9\n |\n 20 | decrement(amounts, addr, 1u8);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = Use `Mapping::{get, get_or, put}` for manipulating on-chain mappings.\nWarning [WPAR0370001]: The keyword `decrement` is deprecated.\n --> compiler-test:21:9\n |\n 21 | decrement(tokens, addr, Token { owner: addr, gates: 1u8, amount: 1u8 });\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = Use `Mapping::{get, get_or, put}` for manipulating on-chain mappings.\nWarning [WPAR0370001]: The keyword `decrement` is deprecated.\n --> compiler-test:22:9\n |\n 22 | decrement(foo, addr, amount);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = Use `Mapping::{get, get_or, put}` for manipulating on-chain mappings."
- "Error [ETYC0372030]: A mapping's value cannot be a record\n --> compiler-test:11:5\n |\n 11 | mapping tokens: address => Token;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372005]: Unknown function `decrement`\n --> compiler-test:18:9\n |\n 18 | decrement(tokens, addr, amount);\n | ^^^^^^^^^\nError [ETYC0372005]: Unknown function `decrement`\n --> compiler-test:19:9\n |\n 19 | decrement(amounts, 1u8, amount);\n | ^^^^^^^^^\nError [ETYC0372005]: Unknown function `decrement`\n --> compiler-test:20:9\n |\n 20 | decrement(amounts, addr, 1u8);\n | ^^^^^^^^^\nError [ETYC0372005]: Unknown function `decrement`\n --> compiler-test:21:9\n |\n 21 | decrement(tokens, addr, Token { owner: addr, gates: 1u8, amount: 1u8 });\n | ^^^^^^^^^\nError [ETYC0372005]: Unknown function `decrement`\n --> compiler-test:22:9\n |\n 22 | decrement(foo, addr, amount);\n | ^^^^^^^^^\nWarning [WPAR0370001]: The keyword `decrement` is deprecated.\n --> compiler-test:18:9\n |\n 18 | decrement(tokens, addr, amount);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = Use `Mapping::{get, get_or, put}` for manipulating on-chain mappings.\nWarning [WPAR0370001]: The keyword `decrement` is deprecated.\n --> compiler-test:19:9\n |\n 19 | decrement(amounts, 1u8, amount);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = Use `Mapping::{get, get_or, put}` for manipulating on-chain mappings.\nWarning [WPAR0370001]: The keyword `decrement` is deprecated.\n --> compiler-test:20:9\n |\n 20 | decrement(amounts, addr, 1u8);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = Use `Mapping::{get, get_or, put}` for manipulating on-chain mappings.\nWarning [WPAR0370001]: The keyword `decrement` is deprecated.\n --> compiler-test:21:9\n |\n 21 | decrement(tokens, addr, Token { owner: addr, gates: 1u8, amount: 1u8 });\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = Use `Mapping::{get, get_or, put}` for manipulating on-chain mappings.\nWarning [WPAR0370001]: The keyword `decrement` is deprecated.\n --> compiler-test:22:9\n |\n 22 | decrement(foo, addr, amount);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = Use `Mapping::{get, get_or, put}` for manipulating on-chain mappings."

View File

@ -1,11 +0,0 @@
---
namespace: Compile
expectation: Pass
outputs:
- - initial_ast: 9ffd4f34e261ee315a2ee29353e707b35c300e928aca532743142a538957c4ce
unrolled_ast: 9ffd4f34e261ee315a2ee29353e707b35c300e928aca532743142a538957c4ce
ssa_ast: 9ea8f3743b9bcf1584319472ca0a80707f117616d687d4c401b34fb10b44703a
flattened_ast: a4eca8b80af9863d59ebfb837fa5dae061fca7d52315d3a9f5778e6dc4b75716
inlined_ast: a4eca8b80af9863d59ebfb837fa5dae061fca7d52315d3a9f5778e6dc4b75716
dce_ast: a4eca8b80af9863d59ebfb837fa5dae061fca7d52315d3a9f5778e6dc4b75716
bytecode: 6db857dc2b80ea257d141b3980404e050024771f95c5f9b74f899145b2001432

View File

@ -1,11 +0,0 @@
---
namespace: Compile
expectation: Pass
outputs:
- - initial_ast: 809ffb6b3ce9e51d58f18a841bbbe79e87bf3b5c0ac2d82d226b3cb66427f235
unrolled_ast: 809ffb6b3ce9e51d58f18a841bbbe79e87bf3b5c0ac2d82d226b3cb66427f235
ssa_ast: efeab621ea3b6113ae3ef1f326cbd75668ce034b81a1bb09a55c9a671f62c127
flattened_ast: 06fea09c85a281be025d66565aa362f80f2036c88c284fbfb5f9b874a605916b
inlined_ast: 06fea09c85a281be025d66565aa362f80f2036c88c284fbfb5f9b874a605916b
dce_ast: 06fea09c85a281be025d66565aa362f80f2036c88c284fbfb5f9b874a605916b
bytecode: 9f1144202f6b114409c379f7ecc4b480dd81daaf0f6f8b244efd20c520f7b76c

View File

@ -1,11 +0,0 @@
---
namespace: Compile
expectation: Pass
outputs:
- - initial_ast: 19378936c22e4e747e16e132bbc727115598dfbd17068349cb300525cde35556
unrolled_ast: 19378936c22e4e747e16e132bbc727115598dfbd17068349cb300525cde35556
ssa_ast: 19378936c22e4e747e16e132bbc727115598dfbd17068349cb300525cde35556
flattened_ast: c55a0edeb6a52dd728e5500ff5b1d387186321c8a3d68f2d0638628bbb05696e
inlined_ast: c55a0edeb6a52dd728e5500ff5b1d387186321c8a3d68f2d0638628bbb05696e
dce_ast: c55a0edeb6a52dd728e5500ff5b1d387186321c8a3d68f2d0638628bbb05696e
bytecode: 49afa4d378578bc680308083733b31b8272f9c952fe8dbc133398676e3f0d2ba

View File

@ -2,4 +2,4 @@
namespace: Compile
expectation: Fail
outputs:
- "Error [ETYC0372005]: Unknown function `increment`\n --> compiler-test:18:9\n |\n 18 | increment(tokens, addr, amount);\n | ^^^^^^^^^\nError [ETYC0372005]: Unknown function `increment`\n --> compiler-test:19:9\n |\n 19 | increment(amounts, 1u8, amount);\n | ^^^^^^^^^\nError [ETYC0372005]: Unknown function `increment`\n --> compiler-test:20:9\n |\n 20 | increment(amounts, addr, 1u8);\n | ^^^^^^^^^\nError [ETYC0372005]: Unknown function `increment`\n --> compiler-test:21:9\n |\n 21 | increment(amounts, addr, Token { owner: addr, gates: 1u64, amount: amount });\n | ^^^^^^^^^\nError [ETYC0372005]: Unknown function `increment`\n --> compiler-test:22:9\n |\n 22 | increment(foo, addr, amount);\n | ^^^^^^^^^\nWarning [WPAR0370001]: The keyword `increment` is deprecated.\n --> compiler-test:18:9\n |\n 18 | increment(tokens, addr, amount);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = Use `Mapping::{get, get_or, put}` for manipulating on-chain mappings.\nWarning [WPAR0370001]: The keyword `increment` is deprecated.\n --> compiler-test:19:9\n |\n 19 | increment(amounts, 1u8, amount);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = Use `Mapping::{get, get_or, put}` for manipulating on-chain mappings.\nWarning [WPAR0370001]: The keyword `increment` is deprecated.\n --> compiler-test:20:9\n |\n 20 | increment(amounts, addr, 1u8);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = Use `Mapping::{get, get_or, put}` for manipulating on-chain mappings.\nWarning [WPAR0370001]: The keyword `increment` is deprecated.\n --> compiler-test:21:9\n |\n 21 | increment(amounts, addr, Token { owner: addr, gates: 1u64, amount: amount });\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = Use `Mapping::{get, get_or, put}` for manipulating on-chain mappings.\nWarning [WPAR0370001]: The keyword `increment` is deprecated.\n --> compiler-test:22:9\n |\n 22 | increment(foo, addr, amount);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = Use `Mapping::{get, get_or, put}` for manipulating on-chain mappings."
- "Error [ETYC0372030]: A mapping's value cannot be a record\n --> compiler-test:11:5\n |\n 11 | mapping tokens: address => Token;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372005]: Unknown function `increment`\n --> compiler-test:18:9\n |\n 18 | increment(tokens, addr, amount);\n | ^^^^^^^^^\nError [ETYC0372005]: Unknown function `increment`\n --> compiler-test:19:9\n |\n 19 | increment(amounts, 1u8, amount);\n | ^^^^^^^^^\nError [ETYC0372005]: Unknown function `increment`\n --> compiler-test:20:9\n |\n 20 | increment(amounts, addr, 1u8);\n | ^^^^^^^^^\nError [ETYC0372005]: Unknown function `increment`\n --> compiler-test:21:9\n |\n 21 | increment(amounts, addr, Token { owner: addr, gates: 1u64, amount: amount });\n | ^^^^^^^^^\nError [ETYC0372005]: Unknown function `increment`\n --> compiler-test:22:9\n |\n 22 | increment(foo, addr, amount);\n | ^^^^^^^^^\nWarning [WPAR0370001]: The keyword `increment` is deprecated.\n --> compiler-test:18:9\n |\n 18 | increment(tokens, addr, amount);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = Use `Mapping::{get, get_or, put}` for manipulating on-chain mappings.\nWarning [WPAR0370001]: The keyword `increment` is deprecated.\n --> compiler-test:19:9\n |\n 19 | increment(amounts, 1u8, amount);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = Use `Mapping::{get, get_or, put}` for manipulating on-chain mappings.\nWarning [WPAR0370001]: The keyword `increment` is deprecated.\n --> compiler-test:20:9\n |\n 20 | increment(amounts, addr, 1u8);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = Use `Mapping::{get, get_or, put}` for manipulating on-chain mappings.\nWarning [WPAR0370001]: The keyword `increment` is deprecated.\n --> compiler-test:21:9\n |\n 21 | increment(amounts, addr, Token { owner: addr, gates: 1u64, amount: amount });\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = Use `Mapping::{get, get_or, put}` for manipulating on-chain mappings.\nWarning [WPAR0370001]: The keyword `increment` is deprecated.\n --> compiler-test:22:9\n |\n 22 | increment(foo, addr, amount);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = Use `Mapping::{get, get_or, put}` for manipulating on-chain mappings."

View File

@ -2,11 +2,11 @@
namespace: Compile
expectation: Pass
outputs:
- - initial_ast: 6e57e1c0c5d4df7eaf414939293c79c156c77f9ee78064dd35572f0d54ec2b85
unrolled_ast: 6e57e1c0c5d4df7eaf414939293c79c156c77f9ee78064dd35572f0d54ec2b85
ssa_ast: 4c6468604104edfe6a6d2a5f4d80c557b001bc60b1e4098f80eda119afdbb292
flattened_ast: bb26f3622ed2fa2f301ac07069ae281a5e5bea1d52fec8cdb03b03131ad0b4f6
inlined_ast: bb26f3622ed2fa2f301ac07069ae281a5e5bea1d52fec8cdb03b03131ad0b4f6
dce_ast: bb26f3622ed2fa2f301ac07069ae281a5e5bea1d52fec8cdb03b03131ad0b4f6
bytecode: 1da5a78fcb6f77bd197de7dce1e7e94e7a9d30a6ec26703a645b25ab7c65cc08
- - initial_ast: ac852a67842b1054112f21181808134b2b33eddedeacb263d3965fa92155deea
unrolled_ast: ac852a67842b1054112f21181808134b2b33eddedeacb263d3965fa92155deea
ssa_ast: 4c717c5610854b3ae84c09bc97997984e55d590620fbae8ed060c259b0b8c674
flattened_ast: 900fbee1813c51d4859f4bd2276459d7cfcccef8447c26b9d16b6f00aab5455c
inlined_ast: 900fbee1813c51d4859f4bd2276459d7cfcccef8447c26b9d16b6f00aab5455c
dce_ast: 900fbee1813c51d4859f4bd2276459d7cfcccef8447c26b9d16b6f00aab5455c
bytecode: b2164bbd276015db50334b15d3b882c988681918982d8e0f144ad2c09fa2ecb9
warnings: ""

View File

@ -2,4 +2,4 @@
namespace: Compile
expectation: Fail
outputs:
- "Error [ETYC0372030]: A mapping's key cannot be a tuple\n --> compiler-test:4:5\n |\n 4 | mapping foo: (u32, u32) => u32;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372017]: The type `baz` is not found in the current scope.\n --> compiler-test:6:5\n |\n 6 | mapping floo: baz => u8;\n | ^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372017]: The type `foo` is not found in the current scope.\n --> compiler-test:8:5\n |\n 8 | mapping bar: foo => baz;\n | ^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372017]: The type `baz` is not found in the current scope.\n --> compiler-test:8:5\n |\n 8 | mapping bar: foo => baz;\n | ^^^^^^^^^^^^^^^^^^^^^^^^\n"
- "Error [ETYC0372030]: A mapping's key cannot be a tuple\n --> compiler-test:4:5\n |\n 4 | mapping foo: (u32, u32) => u32;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372017]: The type `baz` is not found in the current scope.\n --> compiler-test:6:5\n |\n 6 | mapping floo: baz => u8;\n | ^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372017]: The type `foo` is not found in the current scope.\n --> compiler-test:8:5\n |\n 8 | mapping floop: foo => foo;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372017]: The type `foo` is not found in the current scope.\n --> compiler-test:8:5\n |\n 8 | mapping floop: foo => foo;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372017]: The type `foo` is not found in the current scope.\n --> compiler-test:10:5\n |\n 10 | mapping bar: foo => baz;\n | ^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372017]: The type `baz` is not found in the current scope.\n --> compiler-test:10:5\n |\n 10 | mapping bar: foo => baz;\n | ^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372030]: A mapping's value cannot be a record\n --> compiler-test:21:5\n |\n 21 | mapping real_tokens: address => RealToken;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372030]: A mapping's key cannot be a record\n --> compiler-test:23:5\n |\n 23 | mapping owners: RealToken => address;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"

View File

@ -27,16 +27,5 @@ program test.aleo {
mapping foo: Bar => Baz;
record RealToken {
// The token owner.
owner: address,
// The Aleo balance (in gates).
gates: u64,
// The token amount.
amount: u64,
}
mapping real_tokens: address => RealToken;
mapping owners: RealToken => address;
}

View File

@ -7,7 +7,22 @@ program test.aleo {
mapping foo: (u32, u32) => u32;
mapping floo: baz => u8;
mapping floop: foo => foo;
mapping bar: foo => baz;
record RealToken {
// The token owner.
owner: address,
// The Aleo balance (in gates).
gates: u64,
// The token amount.
amount: u64,
}
mapping real_tokens: address => RealToken;
mapping owners: RealToken => address;
}