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