leo/tests/compiler/finalize/read_write_mapping_fail.leo
Pranav Gaddamadugu 6d35560528 More tests
2022-09-07 23:09:11 -07:00

27 lines
593 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(public addr: address) -> public u128 {
return balances[addr];
}
function write_in_finalize(public addr: address, public amount: u128) {
finalize(addr, amount);
} finalize(public: addr: address, public amount: u128) {
balances[addr] = amount;
}