Ak.test nft mint from xch rpc (#14482)

* Mitigate flaky test

* Use already existing wallet_is_synced
This commit is contained in:
Adam Kelly
2023-02-08 19:44:04 -06:00
committed by GitHub
parent f346de94ba
commit d3ad991208
2 changed files with 4 additions and 2 deletions
+2 -2
View File
@@ -508,7 +508,7 @@ class WalletStateManager:
self.pending_tx_callback()
async def synced(self):
async def synced(self) -> bool:
if len(self.server.get_connections(NodeType.FULL_NODE)) == 0:
return False
@@ -516,7 +516,7 @@ class WalletStateManager:
if latest is None:
return False
if "simulator" in self.config.get("selected_network"):
if "simulator" in self.config.get("selected_network", ""):
return True # sim is always synced if we have a genesis block.
if latest.height - await self.blockchain.get_finished_sync_up_to() > 1:
@@ -25,6 +25,7 @@ from chia.wallet.did_wallet.did_wallet import DIDWallet
from chia.wallet.nft_wallet.nft_wallet import NFTWallet
from chia.wallet.nft_wallet.uncurry_nft import UncurriedNFT
from chia.wallet.util.address_type import AddressType
from tests.util.wallet_is_synced import wallet_is_synced
async def nft_count(wallet: NFTWallet) -> int:
@@ -887,6 +888,7 @@ async def test_nft_mint_from_xch_rpc(two_wallet_nodes: Any, trusted: Any, self_h
spends = []
for i in range(0, n, chunk):
await time_out_assert(20, wallet_is_synced, True, wallet_node_maker, full_node_api)
resp: Dict[str, Any] = await client.nft_mint_bulk(
wallet_id=nft_wallet_maker["wallet_id"],
metadata_list=metadata_list[i : i + chunk],