mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-12-27 20:24:52 +03:00
Update tests
This commit is contained in:
parent
25a15aae75
commit
8048d2754b
@ -5,8 +5,7 @@ expectation: Fail
|
||||
|
||||
program test.aleo {
|
||||
function foo(a: u8, b: u8) -> u8 {
|
||||
async finalize(a, b);
|
||||
return a + b;
|
||||
return a + b then finalize(a, b);
|
||||
}
|
||||
|
||||
function bar(a: u8, b: u8) -> u8 {
|
||||
@ -19,7 +18,7 @@ program test.aleo {
|
||||
|
||||
|
||||
function mint_public(receiver: address, amount: u64) {
|
||||
async finalize(receiver, amount);
|
||||
return then finalize(receiver, amount);
|
||||
}
|
||||
|
||||
finalize mint_public(receiver: address, amount: u64) {
|
||||
|
@ -7,7 +7,7 @@ program test.aleo {
|
||||
mapping amounts: address => u128;
|
||||
|
||||
transition decrease_self(amount: u128) {
|
||||
async finalize(self.caller, amount);
|
||||
return then finalize(self.caller, amount);
|
||||
}
|
||||
|
||||
finalize decrease_self(addr: address, amount: u128) {
|
||||
|
@ -14,7 +14,7 @@ program test.aleo {
|
||||
mapping tokens: address => Token;
|
||||
|
||||
transition decrease_self(amount: u128) {
|
||||
async finalize(self.caller, amount);
|
||||
return then finalize(self.caller, amount);
|
||||
}
|
||||
|
||||
finalize decrease_self(addr: address, amount: u128) {
|
||||
|
@ -6,7 +6,7 @@ expectation: Fail
|
||||
program test.aleo {
|
||||
|
||||
transition mint_public(public receiver: address, public amount: u64) {
|
||||
async finalize(receiver, amount);
|
||||
return then finalize(receiver, amount);
|
||||
}
|
||||
|
||||
finalize mint_public (public receiver: address, public amount: u64) {}
|
||||
|
@ -8,15 +8,23 @@ program test.aleo {
|
||||
mapping values: u8 => u8;
|
||||
|
||||
transition mint_public(public receiver: address, public amount: u64) {
|
||||
async finalize(receiver, amount);
|
||||
return then finalize(receiver, amount);
|
||||
}
|
||||
|
||||
finalize mint_public (public receiver: address, public amount: u64) {
|
||||
increment(account, receiver, amount);
|
||||
}
|
||||
|
||||
transition public_adder(public a: u8, public b: u8) {
|
||||
return then finalize(a, b);
|
||||
}
|
||||
|
||||
finalize public_adder(a: u8, b: u8) -> public u8 {
|
||||
return a + b;
|
||||
}
|
||||
|
||||
transition finalize_no_params() {
|
||||
async finalize();
|
||||
return then finalize();
|
||||
}
|
||||
|
||||
finalize finalize_no_params() {
|
||||
|
@ -7,7 +7,7 @@ program test.aleo {
|
||||
mapping account: address => u64;
|
||||
|
||||
transition mint_public(public receiver: address, public amount: u64) {
|
||||
async finalize(receiver, amount);
|
||||
return then finalize(receiver, amount);
|
||||
}
|
||||
|
||||
finalize mint_public (public receiver: address, constant amount: u64) -> constant u64 {
|
||||
@ -15,7 +15,7 @@ program test.aleo {
|
||||
}
|
||||
|
||||
transition mint_public2(public receiver: address, public amount: u64) {
|
||||
async finalize(receiver, amount);
|
||||
return then finalize(receiver, amount);
|
||||
}
|
||||
|
||||
finalize mint_public2(public receiver: address, amount: u64) -> u64 {
|
||||
|
@ -7,7 +7,7 @@ program test.aleo {
|
||||
mapping account: address => u64;
|
||||
|
||||
transition mint_public(public receiver: address, public amount: u64) {
|
||||
async finalize(receiver, amount);
|
||||
return then finalize(receiver, amount);
|
||||
}
|
||||
|
||||
finalize mint_public(public receiver: address, public amount: u64) -> u64 {
|
||||
|
@ -8,7 +8,7 @@ program test.aleo {
|
||||
mapping account: address => u64;
|
||||
|
||||
transition mint_public(public receiver: address, public amount: u64) {
|
||||
async finalize(receiver, amount);
|
||||
return then finalize(receiver, amount);
|
||||
}
|
||||
|
||||
finalize mint_public (public receiver: address, public amount: u64) -> u64 {
|
||||
|
@ -8,7 +8,7 @@ program test.aleo {
|
||||
mapping values: u8 => u8;
|
||||
|
||||
transition mint_public(public receiver: address, public amount: u64) {
|
||||
async finalize(receiver, amount);
|
||||
return then finalize(receiver, amount);
|
||||
}
|
||||
|
||||
finalize mint_private (public receiver: address, public amount: u64) {
|
||||
|
@ -8,7 +8,7 @@ program test.aleo {
|
||||
mapping account: address => u64;
|
||||
|
||||
transition mint_public(public receiver: address, public amount: u64) {
|
||||
async finalize(receiver, amount, amount);
|
||||
return then finalize(receiver, amount, amount);
|
||||
}
|
||||
|
||||
finalize mint_public (public receiver: address, public amount: u64) {
|
||||
|
@ -7,7 +7,7 @@ program test.aleo {
|
||||
mapping amounts: address => u128;
|
||||
|
||||
transition increase_self(amount: u128) {
|
||||
async finalize(self.caller, amount);
|
||||
return then finalize(self.caller, amount);
|
||||
}
|
||||
|
||||
finalize increase_self(addr: address, amount: u128) {
|
||||
|
@ -14,7 +14,7 @@ program test.aleo {
|
||||
mapping tokens: address => Token;
|
||||
|
||||
transition increase_self(amount: u128) {
|
||||
async finalize(self.caller, amount);
|
||||
return then finalize(self.caller, amount);
|
||||
}
|
||||
|
||||
finalize increase_self(addr: address, amount: u128) {
|
||||
|
@ -23,7 +23,7 @@ program test.aleo {
|
||||
}
|
||||
|
||||
function write_in_finalize(public addr: address, public amount: u128) {
|
||||
async finalize(addr, amount);
|
||||
return then finalize(addr, amount);
|
||||
}
|
||||
|
||||
finalize write_in_finalize(public: addr: address, public amount: u128) {
|
||||
|
@ -5,8 +5,7 @@ expectation: Pass
|
||||
|
||||
program test.aleo {
|
||||
transition matches(addr: address) -> bool {
|
||||
async finalize(self.caller);
|
||||
return self.caller == addr;
|
||||
return self.caller == addr then finalize(self.caller);
|
||||
} finalize matches(addr: address) -> bool {
|
||||
return addr == self.caller;
|
||||
}
|
||||
|
@ -3,8 +3,10 @@ namespace: ParseStatement
|
||||
expectation: Pass
|
||||
*/
|
||||
|
||||
async finalize();
|
||||
return then finalize;
|
||||
|
||||
async finalize(foo);
|
||||
return then finalize();
|
||||
|
||||
async finalize(foo, bar);
|
||||
return then finalize(foo);
|
||||
|
||||
return then finalize(foo, bar);
|
||||
|
@ -14,3 +14,5 @@ async async finalize(foo);
|
||||
finalize;
|
||||
|
||||
asyn finalize(foo);
|
||||
|
||||
return then fin;
|
||||
|
Loading…
Reference in New Issue
Block a user