mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2024-09-11 10:56:14 +03:00
Clarify checking compute_memos results in NFT wallet tests (#17137)
Clarify checking compute_memos results in NFT wallet tests.
This commit is contained in:
parent
c1dd6c6930
commit
04f0a7454b
@ -238,7 +238,7 @@ async def test_nft_wallet_creation_and_transfer(self_hostname: str, two_wallet_n
|
||||
sb = await nft_wallet_0.generate_new_nft(metadata, DEFAULT_TX_CONFIG)
|
||||
assert sb is not None
|
||||
# ensure hints are generated
|
||||
assert compute_memos(sb)
|
||||
assert len(compute_memos(sb)) > 0
|
||||
await time_out_assert_not_none(30, full_node_api.full_node.mempool_manager.get_spendbundle, sb.name())
|
||||
|
||||
for i in range(1, num_blocks):
|
||||
@ -271,7 +271,7 @@ async def test_nft_wallet_creation_and_transfer(self_hostname: str, two_wallet_n
|
||||
sb = await nft_wallet_0.generate_new_nft(metadata, DEFAULT_TX_CONFIG)
|
||||
assert sb is not None
|
||||
# ensure hints are generated
|
||||
assert compute_memos(sb)
|
||||
assert len(compute_memos(sb)) > 0
|
||||
await time_out_assert_not_none(10, full_node_api.full_node.mempool_manager.get_spendbundle, sb.name())
|
||||
|
||||
await time_out_assert(30, wallet_node_0.wallet_state_manager.lock.locked, False)
|
||||
@ -294,7 +294,7 @@ async def test_nft_wallet_creation_and_transfer(self_hostname: str, two_wallet_n
|
||||
await time_out_assert_not_none(
|
||||
30, full_node_api.full_node.mempool_manager.get_spendbundle, txs[0].spend_bundle.name()
|
||||
)
|
||||
assert compute_memos(txs[0].spend_bundle)
|
||||
assert len(compute_memos(txs[0].spend_bundle)) > 0
|
||||
|
||||
for i in range(1, num_blocks * 2):
|
||||
await full_node_api.farm_new_transaction_block(FarmNewBlockProtocol(ph1))
|
||||
@ -316,7 +316,7 @@ async def test_nft_wallet_creation_and_transfer(self_hostname: str, two_wallet_n
|
||||
await time_out_assert_not_none(
|
||||
30, full_node_api.full_node.mempool_manager.get_spendbundle, txs[0].spend_bundle.name()
|
||||
)
|
||||
assert compute_memos(txs[0].spend_bundle)
|
||||
assert len(compute_memos(txs[0].spend_bundle)) > 0
|
||||
|
||||
for i in range(1, num_blocks):
|
||||
await full_node_api.farm_new_transaction_block(FarmNewBlockProtocol(ph1))
|
||||
@ -719,7 +719,7 @@ async def test_nft_with_did_wallet_creation(self_hostname: str, two_wallet_nodes
|
||||
sb = resp["spend_bundle"]
|
||||
# ensure hints are generated correctly
|
||||
memos = compute_memos(sb)
|
||||
assert memos
|
||||
assert len(memos) > 0
|
||||
puzhashes = []
|
||||
for x in memos.values():
|
||||
puzhashes.extend(list(x))
|
||||
@ -749,7 +749,7 @@ async def test_nft_with_did_wallet_creation(self_hostname: str, two_wallet_nodes
|
||||
sb = resp["spend_bundle"]
|
||||
|
||||
# ensure hints are generated
|
||||
assert compute_memos(sb)
|
||||
assert len(compute_memos(sb)) > 0
|
||||
await time_out_assert_not_none(30, full_node_api.full_node.mempool_manager.get_spendbundle, sb.name())
|
||||
|
||||
await full_node_api.farm_new_transaction_block(FarmNewBlockProtocol(ph))
|
||||
@ -879,7 +879,7 @@ async def test_nft_rpc_mint(self_hostname: str, two_wallet_nodes: Any, trusted:
|
||||
sb = resp["spend_bundle"]
|
||||
|
||||
# ensure hints are generated
|
||||
assert compute_memos(sb)
|
||||
assert len(compute_memos(sb)) > 0
|
||||
await time_out_assert_not_none(30, full_node_api.full_node.mempool_manager.get_spendbundle, sb.name())
|
||||
|
||||
for i in range(1, num_blocks):
|
||||
@ -1020,7 +1020,7 @@ async def test_nft_transfer_nft_with_did(self_hostname: str, two_wallet_nodes: A
|
||||
)
|
||||
assert resp.get("success")
|
||||
sb = resp["spend_bundle"]
|
||||
assert compute_memos(sb)
|
||||
assert len(compute_memos(sb)) > 0
|
||||
await time_out_assert_not_none(30, full_node_api.full_node.mempool_manager.get_spendbundle, sb.name())
|
||||
await make_new_block_with(resp, full_node_api, ph1)
|
||||
await time_out_assert(30, wallet_0.get_unconfirmed_balance, 5999999999798)
|
||||
@ -1148,7 +1148,7 @@ async def test_update_metadata_for_nft_did(self_hostname: str, two_wallet_nodes:
|
||||
sb = resp["spend_bundle"]
|
||||
|
||||
# ensure hints are generated
|
||||
assert compute_memos(sb)
|
||||
assert len(compute_memos(sb)) > 0
|
||||
await time_out_assert_not_none(30, full_node_api.full_node.mempool_manager.get_spendbundle, sb.name())
|
||||
|
||||
for i in range(1, num_blocks):
|
||||
@ -1281,7 +1281,7 @@ async def test_nft_bulk_set_did(self_hostname: str, two_wallet_nodes: Any, trust
|
||||
)
|
||||
sb = await make_new_block_with(resp, full_node_api, ph, wallet_node_0)
|
||||
# ensure hints are generated
|
||||
assert compute_memos(sb)
|
||||
assert len(compute_memos(sb)) > 0
|
||||
await wait_rpc_state_condition(
|
||||
30, api_0.nft_get_nfts, [{"wallet_id": nft_wallet_0_id}], lambda x: len(x["nft_list"]) > 0
|
||||
)
|
||||
@ -1300,7 +1300,7 @@ async def test_nft_bulk_set_did(self_hostname: str, two_wallet_nodes: Any, trust
|
||||
30, api_0.nft_get_nfts, [{"wallet_id": nft_wallet_0_id}], lambda x: len(x["nft_list"]) > 0
|
||||
)
|
||||
# ensure hints are generated
|
||||
assert compute_memos(sb)
|
||||
assert len(compute_memos(sb)) > 0
|
||||
resp = await api_0.nft_mint_nft(
|
||||
{
|
||||
"wallet_id": nft_wallet_1_id,
|
||||
@ -1312,7 +1312,7 @@ async def test_nft_bulk_set_did(self_hostname: str, two_wallet_nodes: Any, trust
|
||||
)
|
||||
sb = await make_new_block_with(resp, full_node_api, ph, wallet_node_0)
|
||||
# ensure hints are generated
|
||||
assert compute_memos(sb)
|
||||
assert len(compute_memos(sb)) > 0
|
||||
|
||||
# Check DID NFT
|
||||
coins_response = await wait_rpc_state_condition(
|
||||
@ -1447,7 +1447,7 @@ async def test_nft_bulk_transfer(two_wallet_nodes: Any, trusted: Any) -> None:
|
||||
)
|
||||
sb = await make_new_block_with(resp, full_node_api, ph)
|
||||
# ensure hints are generated
|
||||
assert compute_memos(sb)
|
||||
assert len(compute_memos(sb)) > 0
|
||||
await wait_rpc_state_condition(
|
||||
30, api_0.nft_get_nfts, [{"wallet_id": nft_wallet_0_id}], lambda x: len(x["nft_list"]) > 0
|
||||
)
|
||||
@ -1476,7 +1476,7 @@ async def test_nft_bulk_transfer(two_wallet_nodes: Any, trusted: Any) -> None:
|
||||
)
|
||||
sb = await make_new_block_with(resp, full_node_api, ph)
|
||||
# ensure hints are generated
|
||||
assert compute_memos(sb)
|
||||
assert len(compute_memos(sb)) > 0
|
||||
|
||||
# Check DID NFT
|
||||
coins_response = await wait_rpc_state_condition(
|
||||
@ -1507,7 +1507,7 @@ async def test_nft_bulk_transfer(two_wallet_nodes: Any, trusted: Any) -> None:
|
||||
assert resp["tx_num"] == 4
|
||||
sb = await make_new_block_with(resp, full_node_api, ph)
|
||||
# ensure hints are generated
|
||||
assert compute_memos(sb)
|
||||
assert len(compute_memos(sb)) > 0
|
||||
await time_out_assert(30, get_wallet_number, 2, wallet_node_1.wallet_state_manager)
|
||||
coins_response = await wait_rpc_state_condition(
|
||||
30, api_1.nft_get_nfts, [{"wallet_id": 2}], lambda x: len(x["nft_list"]) == 3
|
||||
@ -1593,7 +1593,7 @@ async def test_nft_set_did(self_hostname: str, two_wallet_nodes: Any, trusted: A
|
||||
)
|
||||
sb = await make_new_block_with(resp, full_node_api, ph)
|
||||
# ensure hints are generated
|
||||
assert compute_memos(sb)
|
||||
assert len(compute_memos(sb)) > 0
|
||||
|
||||
# Check DID NFT
|
||||
coins_response = await wait_rpc_state_condition(
|
||||
@ -1747,7 +1747,7 @@ async def test_set_nft_status(self_hostname: str, two_wallet_nodes: Any, trusted
|
||||
sb = resp["spend_bundle"]
|
||||
|
||||
# ensure hints are generated
|
||||
assert compute_memos(sb)
|
||||
assert len(compute_memos(sb)) > 0
|
||||
await time_out_assert_not_none(30, full_node_api.full_node.mempool_manager.get_spendbundle, sb.name())
|
||||
await make_new_block_with(resp, full_node_api, ph)
|
||||
|
||||
@ -1833,7 +1833,7 @@ async def test_nft_sign_message(self_hostname: str, two_wallet_nodes: Any, trust
|
||||
sb = resp["spend_bundle"]
|
||||
|
||||
# ensure hints are generated
|
||||
assert compute_memos(sb)
|
||||
assert len(compute_memos(sb)) > 0
|
||||
await time_out_assert_not_none(30, full_node_api.full_node.mempool_manager.get_spendbundle, sb.name())
|
||||
await make_new_block_with(resp, full_node_api, ph)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user