From 2254bee4394e9b416e5f62f18e53f4b9c20f9e69 Mon Sep 17 00:00:00 2001 From: Matt Date: Tue, 9 Apr 2024 09:08:45 -0700 Subject: [PATCH 1/2] Read from 'transactions' instead of 'tx_records' --- chia/rpc/wallet_rpc_api.py | 13 +++---------- chia/rpc/wallet_rpc_client.py | 2 +- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/chia/rpc/wallet_rpc_api.py b/chia/rpc/wallet_rpc_api.py index 1903f0e9b496..3d36a9a5cc30 100644 --- a/chia/rpc/wallet_rpc_api.py +++ b/chia/rpc/wallet_rpc_api.py @@ -4193,17 +4193,10 @@ async def dl_update_multiple( extra_conditions=extra_conditions, ) tx_records.extend(records) - # Now that we have all the txs, we need to aggregate them all into just one spend - modified_txs: List[TransactionRecord] = [] - aggregate_spend = SpendBundle([], G2Element()) - for tx in tx_records: - if tx.spend_bundle is not None: - aggregate_spend = SpendBundle.aggregate([aggregate_spend, tx.spend_bundle]) - modified_txs.append(dataclasses.replace(tx, spend_bundle=None)) - modified_txs[0] = dataclasses.replace(modified_txs[0], spend_bundle=aggregate_spend) + return { - "tx_records": [rec.to_json_dict_convenience(self.service.config) for rec in modified_txs], - "transactions": [rec.to_json_dict_convenience(self.service.config) for rec in modified_txs], + "tx_records": [rec.to_json_dict_convenience(self.service.config) for rec in tx_records], + "transactions": [rec.to_json_dict_convenience(self.service.config) for rec in tx_records], } async def dl_history(self, request: Dict[str, Any]) -> EndpointResult: diff --git a/chia/rpc/wallet_rpc_client.py b/chia/rpc/wallet_rpc_client.py index 71e8a62d9e96..369a5d18560a 100644 --- a/chia/rpc/wallet_rpc_client.py +++ b/chia/rpc/wallet_rpc_client.py @@ -1168,7 +1168,7 @@ async def dl_update_multiple( **timelock_info.to_json_dict(), } response = await self.fetch("dl_update_multiple", request) - return [TransactionRecord.from_json_dict_convenience(tx) for tx in response["tx_records"]] + return [TransactionRecord.from_json_dict_convenience(tx) for tx in response["transactions"]] async def dl_history( self, From 37b29d6514d3674c71e06b54acec92028335fd3c Mon Sep 17 00:00:00 2001 From: Matt Date: Tue, 9 Apr 2024 10:43:37 -0700 Subject: [PATCH 2/2] Remove tx_records from dl_update_multiple --- chia/rpc/wallet_rpc_api.py | 1 - 1 file changed, 1 deletion(-) diff --git a/chia/rpc/wallet_rpc_api.py b/chia/rpc/wallet_rpc_api.py index 3d36a9a5cc30..cc481bc6a90a 100644 --- a/chia/rpc/wallet_rpc_api.py +++ b/chia/rpc/wallet_rpc_api.py @@ -4195,7 +4195,6 @@ async def dl_update_multiple( tx_records.extend(records) return { - "tx_records": [rec.to_json_dict_convenience(self.service.config) for rec in tx_records], "transactions": [rec.to_json_dict_convenience(self.service.config) for rec in tx_records], }