leo/tests/compiler/finalize/finalize.leo

34 lines
657 B
Plaintext
Raw Normal View History

2022-09-07 20:39:00 +03:00
/*
namespace: Compile
expectation: Pass
*/
mapping account: address => u64;
2022-09-08 09:09:11 +03:00
mapping values: u8 => u8;
2022-09-07 20:39:00 +03:00
@program
function mint_public(public receiver: address, public amount: u64) {
finalize(receiver, amount);
2022-09-13 12:06:24 +03:00
}
finalize mint_public (public receiver: address, public amount: u64) {
2022-09-07 20:39:00 +03:00
increment(account, receiver, amount);
}
2022-09-08 09:09:11 +03:00
@program
function public_adder(public a: u8, public b: u8) {
finalize(a, b);
2022-09-13 12:06:24 +03:00
} finalize public_adder(a: u8, b: u8) -> public u8 {
2022-09-08 09:09:11 +03:00
return a + b;
}
@program
function finalize_no_params() {
finalize();
2022-09-13 12:06:24 +03:00
}
finalize finalize_no_params() {
2022-09-08 09:09:11 +03:00
increment(values, 0u8, 1u8);
increment(account, self.caller, 1u64);
}