//# publish module 0x42.Account { import 0x1.Account; import 0x1.signer; struct T has key {sequence_number: u64} public new(m: u64): Self.T { label b0: return T{sequence_number: move(m)}; } public sequence_number(this: &Self.T): u64 { let ref: &u64; label b0: ref = ©(this).T::sequence_number; _ = move(this); return *move(ref); } public publish(account: &signer, r: Self.T) { label b0: move_to(copy(account), move(r)); return; } public test(account: &signer) acquires T { let c1: Self.T; let sender: address; let sequence_number: u64; let fake_ref: &mut Self.T; let fake_ref_frozen: &Self.T; let fake_value: u64; label b0: c1 = Self.new(112); Self.publish(copy(account), move(c1)); sender = signer.address_of(copy(account)); sequence_number = Account.sequence_number(copy(sender)); assert(copy(sequence_number) == 1, 42); fake_ref = borrow_global_mut(copy(sender)); fake_ref_frozen = freeze(move(fake_ref)); fake_value = Self.sequence_number(move(fake_ref_frozen)); assert(copy(fake_value) == 112, 43); return; } } //# run --signers 0x1 import 0x42.Account as MyAccount; main(account: signer) { label b0: MyAccount.test(&account); return; }