Skip to content

Commit 7a426e5

Browse files
authored
More precise tx selection in test_create_signed_transaction (#20697)
1 parent 3b8a33d commit 7a426e5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

chia/_tests/wallet/rpc/test_wallet_rpc.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -651,11 +651,12 @@ async def test_create_signed_transaction(
651651
)
652652
).transactions
653653
change_expected = not selected_coin or selected_coin.amount - amount_total > 0
654-
assert_tx_amounts(txs[-1], outputs, amount_fee=amount_fee, change_expected=change_expected, is_cat=is_cat)
654+
655+
main_tx = next(tx for tx in txs if tx.amount > 0)
656+
assert_tx_amounts(main_tx, outputs, amount_fee=amount_fee, change_expected=change_expected, is_cat=is_cat)
655657

656658
# Farm the transaction and make sure the wallet balance reflects it correct
657-
spend_bundle = txs[0].spend_bundle
658-
assert spend_bundle is not None
659+
spend_bundle = next(tx.spend_bundle for tx in txs if tx.spend_bundle is not None)
659660
xch_delta = amount_total if not is_cat else amount_fee
660661
cat_delta = amount_total if is_cat else 0
661662
await wallet_environments.process_pending_states(

0 commit comments

Comments
 (0)