leo/tests/compiler/finalize/read_write_mapping_fail.leo
2022-09-21 13:18:50 -07:00

31 lines
636 B
Plaintext

/*
namespace: Compile
expectation: Fail
*/
mapping balances: address => u128;
function read(public addr: address) -> public u128 {
return balances[addr];
}
function write(public addr: address, public amount: u128) {
balances[addr] = amount;
}
function read_in_finalize(public addr: address) {
finalize(addr);
}
finalize read_in_finalize(public addr: address) -> public u128 {
return balances[addr];
}
function write_in_finalize(public addr: address, public amount: u128) {
async finalize(addr, amount);
}
finalize write_in_finalize(public: addr: address, public amount: u128) {
balances[addr] = amount;
}