//# publish module 0x1.M { struct Y has store { x: u64 } struct R has key { x: bool, y: Self.Y } public publish(s: &signer) { label b0: move_to(move(s), R { x: false, y: Y { x: 0 } }); return; } public modify_x(addr: address) acquires R { label b0: *&mut borrow_global_mut(move(addr)).R::x = true; return; } public verify_x(addr: address) acquires R { label b0: assert(*&borrow_global(move(addr)).R::x == true, 1000); return; } public modify_y_x(addr: address) acquires R { label b0: *&mut ((&mut borrow_global_mut(move(addr)).R::y)).Y::x = 42; return; } public verify_y_x(addr: address) acquires R { label b0: assert(*&(&borrow_global(move(addr)).R::y).Y::x == 42, 1001); return; } } //# run --signers 0x1 import 0x1.M; main(s: signer) { label b0: M.publish(&s); return; } //# run --signers 0x1 import 0x1.M; import 0x1.signer; main(s: signer) { label b0: M.modify_x(signer.address_of(&s)); return; } //# run --signers 0x1 import 0x1.M; import 0x1.signer; main(s: signer) { label b0: M.verify_x(signer.address_of(&s)); return; } //# run --signers 0x1 import 0x1.M; import 0x1.signer; main(s: signer) { label b0: M.modify_y_x(signer.address_of(&s)); return; } //# run --signers 0x1 import 0x1.M; import 0x1.signer; main(s: signer) { label b0: M.verify_y_x(signer.address_of(&s)); return; }