|
9 | 9 |
|
10 | 10 | //! Further functional tests which test blockchain reorganizations.
|
11 | 11 |
|
12 |
| -use crate::sign::EcdsaChannelSigner; |
| 12 | +use crate::sign::{EcdsaChannelSigner, SpendableOutputDescriptor}; |
13 | 13 | use crate::chain::channelmonitor::{ANTI_REORG_DELAY, LATENCY_GRACE_PERIOD_BLOCKS, Balance};
|
14 | 14 | use crate::chain::transaction::OutPoint;
|
15 | 15 | use crate::chain::chaininterface::{LowerBoundedFeeEstimator, compute_feerate_sat_per_1000_weight};
|
@@ -2230,16 +2230,21 @@ fn test_anchors_aggregated_revoked_htlc_tx() {
|
2230 | 2230 |
|
2231 | 2231 | assert!(nodes[1].chain_monitor.chain_monitor.get_and_clear_pending_events().is_empty());
|
2232 | 2232 | let spendable_output_events = nodes[0].chain_monitor.chain_monitor.get_and_clear_pending_events();
|
2233 |
| - assert_eq!(spendable_output_events.len(), 2); |
2234 |
| - for event in spendable_output_events.iter() { |
2235 |
| - if let Event::SpendableOutputs { outputs, channel_id } = event { |
| 2233 | + assert_eq!(spendable_output_events.len(), 4); |
| 2234 | + for event in spendable_output_events { |
| 2235 | + if let Event::SpendableOutputs { mut outputs, channel_id } = event { |
2236 | 2236 | assert_eq!(outputs.len(), 1);
|
2237 | 2237 | assert!(vec![chan_b.2, chan_a.2].contains(&channel_id.unwrap()));
|
| 2238 | + let spendable_output = outputs.pop().unwrap(); |
2238 | 2239 | let spend_tx = nodes[0].keys_manager.backing.spend_spendable_outputs(
|
2239 |
| - &[&outputs[0]], Vec::new(), Script::new_op_return(&[]), 253, None, &Secp256k1::new(), |
| 2240 | + &[&spendable_output], Vec::new(), Script::new_op_return(&[]), 253, None, &Secp256k1::new(), |
2240 | 2241 | ).unwrap();
|
2241 | 2242 |
|
2242 |
| - check_spends!(spend_tx, revoked_claim_transactions.get(&spend_tx.input[0].previous_output.txid).unwrap()); |
| 2243 | + if let SpendableOutputDescriptor::StaticPaymentOutput(descriptor) = &spendable_output { |
| 2244 | + check_spends!(spend_tx, &revoked_commitment_a, &revoked_commitment_b); |
| 2245 | + } else { |
| 2246 | + check_spends!(spend_tx, revoked_claim_transactions.get(&spend_tx.input[0].previous_output.txid).unwrap()); |
| 2247 | + } |
2243 | 2248 | } else {
|
2244 | 2249 | panic!("unexpected event");
|
2245 | 2250 | }
|
|
0 commit comments