This repository has been archived by the owner on Mar 19, 2024. It is now read-only.
-
在 publish sui move by example 2.5. Shared Object 中的例子后,遇到两个问题:
根据 demo 自己写的单测报错,是获取共享对象有问题吗?不能通过自己的地址获取? #[test]
fun test_init() {
let ts = ts::begin(SELLER);
{
ts::next_tx(&mut ts, SELLER);
init(ts::ctx(&mut ts));
};
{
ts::next_tx(&mut ts, SELLER);
let shop: DonutShop = ts::take_from_sender(&ts);
let b = balance::value(balance(&shop));
assert!(b == 0, 1);
ts::return_to_sender(&ts, shop);
};
ts::end(ts);
} 运行
包地址:0x04213c3c0b2699cc798f1385d5ac3d3241c4cd28695de16361d6f63fc1136ca8
太晚了,昏昏沉沉了。 有人知道为什么吗? |
Beta Was this translation helpful? Give feedback.
Answered by
Xunle1
Nov 17, 2023
Replies: 2 comments 1 reply
-
奇怪,今天早上调用 package 直接通过了 |
Beta Was this translation helpful? Give feedback.
1 reply
-
获取共享对象要使用 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Xunle1
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
获取共享对象要使用
sui::test_scenario::take_shared
和sui::test_scenario::return_shread
替代