diff --git a/examples/broken_bank/src/main.leo b/examples/broken_bank/src/main.leo index dc8e244abd..50d5931614 100644 --- a/examples/broken_bank/src/main.leo +++ b/examples/broken_bank/src/main.leo @@ -28,7 +28,7 @@ function deposit(token: Token, amount: u64) -> Token { let hash: field = BHP256::hash(token.owner); - finalize(hash, amount); + async finalize(hash, amount); return remaining; } @@ -50,7 +50,7 @@ function withdraw(recipient: address, amount: u64, rate: u64, periods: u64) -> T amount: total, }; - finalize(hash, amount); + async finalize(hash, amount); return token; } diff --git a/examples/token/src/main.leo b/examples/token/src/main.leo index 04b4efc823..b560c132e2 100644 --- a/examples/token/src/main.leo +++ b/examples/token/src/main.leo @@ -17,7 +17,7 @@ record token { @program function mint_public(public receiver: address, public amount: u64) { // Mint the tokens publicly by invoking the computation on-chain. - finalize(receiver, amount); + async finalize(receiver, amount); } finalize mint_public(public receiver: address, public amount: u64) { @@ -41,7 +41,7 @@ function mint_private(receiver: address, amount: u64) -> token { @program function transfer_public(public receiver: address, public amount: u64) { // Transfer the tokens publicly, by invoking the computation on-chain. - finalize(self.caller, receiver, amount); + async finalize(self.caller, receiver, amount); } finalize transfer_public(public sender: address, public receiver: address, public amount: u64) { @@ -98,7 +98,7 @@ function transfer_private_to_public(sender: token, public receiver: address, pub }; // Increment the token amount publicly for the token receiver. - finalize(receiver, amount); + async finalize(receiver, amount); // Output the sender's change record. return remaining; @@ -123,7 +123,7 @@ function transfer_public_to_private(public receiver: address, public amount: u64 }; // Decrement the token amount of the caller publicly. - finalize(self.caller, amount); + async finalize(self.caller, amount); // Output the receiver's record. return transferred; diff --git a/examples/vote/src/main.leo b/examples/vote/src/main.leo index d55de0d691..81ea197d2e 100644 --- a/examples/vote/src/main.leo +++ b/examples/vote/src/main.leo @@ -42,7 +42,7 @@ function propose(public info: ProposalInfo) -> Proposal { let id: field = BHP256::hash(info.title); // Finalize the proposal id. - finalize(id); + async finalize(id); // Return a new record for the proposal. return Proposal { @@ -64,7 +64,7 @@ function new_ticket( public voter: address, ) -> Ticket { // Finalize the proposal id for the ticket. - finalize(pid); + async finalize(pid); return Ticket { owner: voter, @@ -80,7 +80,7 @@ finalize new_ticket(public pid: field) { // Vote to agree with a proposal. @program function agree(ticket: Ticket) {// Privately cast the vote. - finalize(ticket.pid); + async finalize(ticket.pid); } finalize agree(public pid: field) {// Publicly increment the number of agree votes. increment(agree_votes, pid, 1u64); @@ -89,7 +89,7 @@ finalize agree(public pid: field) {// Publicly increment the number of agree vot // Vote to disagree with a proposal. @program function disagree(ticket: Ticket) {// Privately cast the vote. - finalize(ticket.pid); + async finalize(ticket.pid); } finalize disagree(pid: field) {// Publicly increment the number of disagree votes. increment(disagree_votes, pid, 1u64);