Skip to content

Commit

Permalink
Remove tx_records from dl_update_multiple RPC (breaking change) (#…
Browse files Browse the repository at this point in the history
…17846)

* Read from 'transactions' instead of 'tx_records'

* Remove tx_records from dl_update_multiple
  • Loading branch information
Quexington authored Apr 15, 2024
1 parent 59ee943 commit 198dfa2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
12 changes: 2 additions & 10 deletions chia/rpc/wallet_rpc_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4183,17 +4183,9 @@ 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],
"transactions": [rec.to_json_dict_convenience(self.service.config) for rec in tx_records],
}

async def dl_history(self, request: Dict[str, Any]) -> EndpointResult:
Expand Down
2 changes: 1 addition & 1 deletion chia/rpc/wallet_rpc_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 198dfa2

Please sign in to comment.