mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2024-09-20 16:08:51 +03:00
Merge pull request #12138 from Chia-Network/nft1_get_info_fix
Fix DID ID mismatch
This commit is contained in:
commit
91b3ab3886
@ -1588,11 +1588,17 @@ class WalletRpcApi:
|
||||
# Note: This is not the actual unspent NFT full puzzle.
|
||||
# There is no way to rebuild the full puzzle in a different wallet.
|
||||
# But it shouldn't have impact on generating the NFTInfo, since inner_puzzle is not used there.
|
||||
if uncurried_nft.supports_did:
|
||||
inner_puzzle = nft_puzzles.recurry_nft_puzzle(
|
||||
uncurried_nft, coin_spend.solution.to_program(), uncurried_nft.p2_puzzle
|
||||
)
|
||||
else:
|
||||
inner_puzzle = uncurried_nft.p2_puzzle
|
||||
full_puzzle = nft_puzzles.create_full_puzzle(
|
||||
uncurried_nft.singleton_launcher_id,
|
||||
metadata,
|
||||
uncurried_nft.metadata_updater_hash,
|
||||
uncurried_nft.inner_puzzle,
|
||||
inner_puzzle,
|
||||
)
|
||||
|
||||
# Get launcher coin
|
||||
|
@ -1220,6 +1220,10 @@ async def test_nft_set_did(two_wallet_nodes: Any, trusted: Any) -> None:
|
||||
assert coins[0].owner_did.hex() == hex_did_id
|
||||
nft_coin_id = coins[0].nft_coin_id
|
||||
|
||||
resp = await api_0.nft_get_info(dict(coin_id=nft_coin_id.hex(), latest=True))
|
||||
assert resp["success"]
|
||||
assert coins[0] == resp["nft_info"]
|
||||
|
||||
# Test set DID1 -> DID2
|
||||
hex_did_id = did_wallet1.get_my_DID()
|
||||
hmr_did_id = encode_puzzle_hash(bytes32.from_hexstr(hex_did_id), DID_HRP)
|
||||
@ -1245,6 +1249,9 @@ async def test_nft_set_did(two_wallet_nodes: Any, trusted: Any) -> None:
|
||||
assert len(coins) == 1
|
||||
assert coins[0].owner_did.hex() == hex_did_id
|
||||
nft_coin_id = coins[0].nft_coin_id
|
||||
resp = await api_0.nft_get_info(dict(coin_id=nft_coin_id.hex(), latest=True))
|
||||
assert resp["success"]
|
||||
assert coins[0] == resp["nft_info"]
|
||||
# Test set DID2 -> None
|
||||
resp = await api_0.nft_set_nft_did(dict(wallet_id=nft_wallet_2_id, nft_coin_id=nft_coin_id.hex()))
|
||||
await make_new_block_with(resp, full_node_api, ph)
|
||||
@ -1257,6 +1264,10 @@ async def test_nft_set_did(two_wallet_nodes: Any, trusted: Any) -> None:
|
||||
assert len(coins) == 1
|
||||
assert coins[0].owner_did is None
|
||||
assert len(wallet_node_0.wallet_state_manager.wallets[nft_wallet_2_id].my_nft_coins) == 0
|
||||
nft_coin_id = coins[0].nft_coin_id
|
||||
resp = await api_0.nft_get_info(dict(coin_id=nft_coin_id.hex(), latest=True))
|
||||
assert resp["success"]
|
||||
assert coins[0] == resp["nft_info"]
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
Loading…
Reference in New Issue
Block a user