Repository: Chia-Network/chia-blockchain

Issue:
[Bug] CLI error returned when running `chia plotnft claim`
### What happened?

```
chia plotnft claim -i 2

Will claim rewards for wallet ID: 2.
Error performing operation on Plot NFT -f xxxxxxxxxx wallet id: 2: 'dict' object has no attribute 'name'
```

The claim transaction does go through - but the CLI is reporting an error.

### Version

1.3

### What platform are you using?

Linux

### What ui mode are you using?

CLI

### Relevant log output

_No response_


Discussion:

Resolving patch:
diff --git a/chia/cmds/plotnft_funcs.py b/chia/cmds/plotnft_funcs.py
--- a/chia/cmds/plotnft_funcs.py
+++ b/chia/cmds/plotnft_funcs.py
@@ -279,7 +279,8 @@ async def submit_tx_with_confirmation(
 
     if user_input.lower() == "y" or user_input.lower() == "yes":
         try:
-            tx_record: TransactionRecord = await func()
+            result: Dict = await func()
+            tx_record: TransactionRecord = result["transaction"]
             start = time.time()
             while time.time() - start < 10:
                 await asyncio.sleep(0.1)
diff --git a/chia/rpc/wallet_rpc_client.py b/chia/rpc/wallet_rpc_client.py
--- a/chia/rpc/wallet_rpc_client.py
+++ b/chia/rpc/wallet_rpc_client.py
@@ -12,6 +12,13 @@
 from chia.wallet.transaction_sorting import SortKey
 
 
+def parse_result_transactions(result: Dict[str, Any]) -> Dict[str, Any]:
+    result["transaction"] = TransactionRecord.from_json_dict(result["transaction"])
+    if result["fee_transaction"]:
+        result["fee_transaction"] = TransactionRecord.from_json_dict(result["fee_transaction"])
+    return result
+
+
 class WalletRpcClient(RpcClient):
     """
     Client to Chia RPC, connects to a local wallet. Uses HTTP/JSON, and converts back from
@@ -291,10 +298,10 @@ async def create_new_pool_wallet(
         res = await self.fetch("create_new_wallet", request)
         return TransactionRecord.from_json_dict(res["transaction"])
 
-    async def pw_self_pool(self, wallet_id: str, fee: uint64) -> TransactionRecord:
-        return TransactionRecord.from_json_dict(
-            (await self.fetch("pw_self_pool", {"wallet_id": wallet_id, "fee": fee}))["transaction"]
-        )
+    async def pw_self_pool(self, wallet_id: str, fee: uint64) -> Dict:
+        reply = await self.fetch("pw_self_pool", {"wallet_id": wallet_id, "fee": fee})
+        reply = parse_result_transactions(reply)
+        return reply
 
     async def pw_join_pool(
         self, wallet_id: str, target_puzzlehash: bytes32, pool_url: str, relative_lock_height: uint32, fee: uint64
@@ -308,17 +315,13 @@ async def pw_join_pool(
         }
 
         reply = await self.fetch("pw_join_pool", request)
-        reply["transaction"] = TransactionRecord.from_json_dict(reply["transaction"])
-        if reply["fee_transaction"]:
-            reply["fee_transaction"] = TransactionRecord.from_json_dict(reply["fee_transaction"])
-        return reply["transaction"]
+        reply = parse_result_transactions(reply)
+        return reply
 
     async def pw_absorb_rewards(self, wallet_id: str, fee: uint64 = uint64(0)) -> Dict:
         reply = await self.fetch("pw_absorb_rewards", {"wallet_id": wallet_id, "fee": fee})
         reply["state"] = PoolWalletInfo.from_json_dict(reply["state"])
-        reply["transaction"] = TransactionRecord.from_json_dict(reply["transaction"])
-        if reply["fee_transaction"]:
-            reply["fee_transaction"] = TransactionRecord.from_json_dict(reply["fee_transaction"])
+        reply = parse_result_transactions(reply)
         return reply
 
     async def pw_status(self, wallet_id: str) -> Tuple[PoolWalletInfo, List[TransactionRecord]]:


Test patch:
diff --git a/tests/pools/test_pool_rpc.py b/tests/pools/test_pool_rpc.py
--- a/tests/pools/test_pool_rpc.py
+++ b/tests/pools/test_pool_rpc.py
@@ -3,7 +3,7 @@
 from dataclasses import dataclass
 from pathlib import Path
 from shutil import rmtree
-from typing import Optional, List, Dict
+from typing import Any, Optional, List, Dict
 
 import pytest
 import pytest_asyncio
@@ -802,20 +802,24 @@ async def test_self_pooling_to_pooling(self, setup, fee, trusted):
             assert status.target is None
             assert status_2.target is None
 
-            join_pool_tx: TransactionRecord = await client.pw_join_pool(
-                wallet_id,
-                pool_ph,
-                "https://pool.example.com",
-                10,
-                fee,
-            )
-            join_pool_tx_2: TransactionRecord = await client.pw_join_pool(
-                wallet_id_2,
-                pool_ph,
-                "https://pool.example.com",
-                10,
-                fee,
-            )
+            join_pool_tx: TransactionRecord = (
+                await client.pw_join_pool(
+                    wallet_id,
+                    pool_ph,
+                    "https://pool.example.com",
+                    10,
+                    fee,
+                )
+            )["transaction"]
+            join_pool_tx_2: TransactionRecord = (
+                await client.pw_join_pool(
+                    wallet_id_2,
+                    pool_ph,
+                    "https://pool.example.com",
+                    10,
+                    fee,
+                )
+            )["transaction"]
             assert join_pool_tx is not None
             assert join_pool_tx_2 is not None
 
@@ -919,13 +923,15 @@ async def have_chia():
             assert status.current.state == PoolSingletonState.SELF_POOLING.value
             assert status.target is None
 
-            join_pool_tx: TransactionRecord = await client.pw_join_pool(
-                wallet_id,
-                pool_ph,
-                "https://pool.example.com",
-                5,
-                fee,
-            )
+            join_pool_tx: TransactionRecord = (
+                await client.pw_join_pool(
+                    wallet_id,
+                    pool_ph,
+                    "https://pool.example.com",
+                    5,
+                    fee,
+                )
+            )["transaction"]
             assert join_pool_tx is not None
 
             status: PoolWalletInfo = (await client.pw_status(wallet_id))[0]
@@ -953,9 +959,9 @@ async def status_is_farming_to_pool():
 
             status: PoolWalletInfo = (await client.pw_status(wallet_id))[0]
 
-            leave_pool_tx: TransactionRecord = await client.pw_self_pool(wallet_id, fee)
-            assert leave_pool_tx.wallet_id == wallet_id
-            assert leave_pool_tx.amount == 1
+            leave_pool_tx: Dict[str, Any] = await client.pw_self_pool(wallet_id, fee)
+            assert leave_pool_tx["transaction"].wallet_id == wallet_id
+            assert leave_pool_tx["transaction"].amount == 1
 
             async def status_is_leaving():
                 await self.farm_blocks(full_node_api, our_ph, 1)
@@ -1054,13 +1060,15 @@ async def status_is_farming_to_pool():
             assert pw_info.current.relative_lock_height == 5
             status: PoolWalletInfo = (await client.pw_status(wallet_id))[0]
 
-            join_pool_tx: TransactionRecord = await client.pw_join_pool(
-                wallet_id,
-                pool_b_ph,
-                "https://pool-b.org",
-                10,
-                fee,
-            )
+            join_pool_tx: TransactionRecord = (
+                await client.pw_join_pool(
+                    wallet_id,
+                    pool_b_ph,
+                    "https://pool-b.org",
+                    10,
+                    fee,
+                )
+            )["transaction"]
             assert join_pool_tx is not None
 
             async def status_is_leaving():
@@ -1156,13 +1164,15 @@ async def status_is_farming_to_pool():
             assert pw_info.current.pool_url == "https://pool-a.org"
             assert pw_info.current.relative_lock_height == 5
 
-            join_pool_tx: TransactionRecord = await client.pw_join_pool(
-                wallet_id,
-                pool_b_ph,
-                "https://pool-b.org",
-                10,
-                fee,
-            )
+            join_pool_tx: TransactionRecord = (
+                await client.pw_join_pool(
+                    wallet_id,
+                    pool_b_ph,
+                    "https://pool-b.org",
+                    10,
+                    fee,
+                )
+            )["transaction"]
             assert join_pool_tx is not None
             await time_out_assert(
                 10,