//! account: bob, 1000000 //! account: carol, 1000000 import 0x0.LibraAccount; import 0x0.LibraCoin; main() { let addr1: address; let addr2: address; let addr3: address; let struct1_original_balance: u64; let struct2_original_balance: u64; let struct3_original_balance: u64; let five_coins1: R#LibraCoin.T; let fc_ref: &mut R#LibraCoin.T; let five_coins2: R#LibraCoin.T; let struct1_new_balance: u64; let struct2_new_balance: u64; let struct3_new_balance: u64; addr1 = get_txn_sender(); addr2 = {{bob}}; addr3 = {{carol}}; struct1_original_balance = LibraAccount.balance(copy(addr1)); struct2_original_balance = LibraAccount.balance(copy(addr2)); struct3_original_balance = LibraAccount.balance(copy(addr3)); five_coins1 = LibraAccount.withdraw_from_sender(10); fc_ref = &mut five_coins1; five_coins2 = LibraCoin.withdraw(move(fc_ref), 5); LibraAccount.deposit(copy(addr2), move(five_coins1)); LibraAccount.deposit(copy(addr3), move(five_coins2)); struct1_new_balance = LibraAccount.balance(copy(addr1)); struct2_new_balance = LibraAccount.balance(copy(addr2)); struct3_new_balance = LibraAccount.balance(copy(addr3)); assert(copy(struct1_new_balance) == copy(struct1_original_balance) - 10, 41); assert(copy(struct2_new_balance) == copy(struct2_original_balance) + 5, 42); assert(copy(struct3_new_balance) == copy(struct3_original_balance) + 5, 43); return; }