From 3bc2fbff355ff1b61ce4339e25e2ab44b5dcd951 Mon Sep 17 00:00:00 2001 From: Matt Hauff Date: Tue, 19 Nov 2024 12:22:19 -0800 Subject: [PATCH] [CHIA-1696] Show an `INCOMING_TX` for pool reward claims (#18887) * Show an `INCOMING_TX` for pool reward claims * The last thing worked, but not really --- chia/_tests/pools/test_pool_rpc.py | 11 +++++++++++ chia/pools/pool_wallet.py | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/chia/_tests/pools/test_pool_rpc.py b/chia/_tests/pools/test_pool_rpc.py index c480f73836f0..e8be4bf8f71c 100644 --- a/chia/_tests/pools/test_pool_rpc.py +++ b/chia/_tests/pools/test_pool_rpc.py @@ -35,6 +35,7 @@ from chia.util.ints import uint32, uint64 from chia.wallet.derive_keys import find_authentication_sk, find_owner_sk from chia.wallet.transaction_record import TransactionRecord +from chia.wallet.util.transaction_type import TransactionType from chia.wallet.util.tx_config import DEFAULT_TX_CONFIG from chia.wallet.util.wallet_types import WalletType from chia.wallet.wallet_node import WalletNode @@ -444,6 +445,16 @@ async def test_absorb_self( await full_node_api.farm_blocks_to_puzzlehash(count=2, farm_to=our_ph, guarantee_transaction_blocks=True) await full_node_api.wait_for_wallet_synced(wallet_node=wallet_node, timeout=20) await full_node_api.check_transactions_confirmed(wallet_node.wallet_state_manager, absorb_txs) + assert ( + len( + [ + tx + for tx in await wallet_node.wallet_state_manager.tx_store.get_all_transactions() + if TransactionType(tx.type) is TransactionType.INCOMING_TX and tx.amount == 1_750_000_000_000 + ] + ) + == 2 + ) new_status: PoolWalletInfo = (await client.pw_status(2))[0] assert status.current == new_status.current assert status.tip_singleton_coin_id != new_status.tip_singleton_coin_id diff --git a/chia/pools/pool_wallet.py b/chia/pools/pool_wallet.py index 1be62fb12e05..0cf6356d40e2 100644 --- a/chia/pools/pool_wallet.py +++ b/chia/pools/pool_wallet.py @@ -818,7 +818,7 @@ async def claim_pool_rewards( confirmed=False, sent=uint32(0), spend_bundle=claim_spend, - additions=claim_spend.additions(), + additions=[add for add in claim_spend.additions() if add.amount == last_solution.coin.amount], removals=claim_spend.removals(), wallet_id=uint32(self.wallet_id), sent_to=[],