Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove tx_records from dl_update_multiple RPC (breaking change) #17846

Merged
merged 2 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 2 additions & 10 deletions chia/rpc/wallet_rpc_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4193,17 +4193,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