Merge pull request #11906 from AmineKhaldi/nft_mint_wallet_validation

NFT minting RPC API: Provide a meaningful error when the wallet provided is not an NFT one
This commit is contained in:
Amine Khaldi
2022-06-17 10:59:13 +01:00
committed by GitHub
+2 -1
View File
@@ -1339,7 +1339,8 @@ class WalletRpcApi:
wallet_id = uint32(request["wallet_id"])
assert self.service.wallet_state_manager
nft_wallet: NFTWallet = self.service.wallet_state_manager.wallets[wallet_id]
assert nft_wallet.type() == WalletType.NFT.value
if nft_wallet.type() != WalletType.NFT.value:
return {"success": False, "error": f"Wallet with id {wallet_id} is not an NFT one"}
royalty_address = request.get("royalty_address")
if isinstance(royalty_address, str):
royalty_puzhash = decode_puzzle_hash(royalty_address)