@@ -15,7 +15,7 @@ use crate::sign::EntropySource;
15
15
use crate :: chain:: channelmonitor:: ChannelMonitor ;
16
16
use crate :: chain:: transaction:: OutPoint ;
17
17
use crate :: events:: { ClaimedHTLC , ClosureReason , Event , HTLCDestination , MessageSendEvent , MessageSendEventsProvider , PathFailure , PaymentPurpose , PaymentFailureReason } ;
18
- use crate :: events:: bump_transaction:: { BumpTransactionEventHandler , Wallet , WalletSource } ;
18
+ use crate :: events:: bump_transaction:: { BumpTransactionEvent , BumpTransactionEventHandler , Wallet , WalletSource } ;
19
19
use crate :: ln:: { ChannelId , PaymentPreimage , PaymentHash , PaymentSecret } ;
20
20
use crate :: ln:: channelmanager:: { AChannelManager , ChainParameters , ChannelManager , ChannelManagerReadArgs , RAACommitmentOrder , PaymentSendFailure , RecipientOnionFields , PaymentId , MIN_CLTV_EXPIRY_DELTA } ;
21
21
use crate :: routing:: gossip:: { P2PGossipSync , NetworkGraph , NetworkUpdate } ;
@@ -1499,11 +1499,26 @@ macro_rules! check_closed_event {
1499
1499
check_closed_event!( $node, $events, $reason, false , $counterparty_node_ids, $channel_capacity) ;
1500
1500
} ;
1501
1501
( $node: expr, $events: expr, $reason: expr, $is_check_discard_funding: expr, $counterparty_node_ids: expr, $channel_capacity: expr) => {
1502
- $crate:: ln:: functional_test_utils:: check_closed_event( & $node, $events, $reason,
1502
+ $crate:: ln:: functional_test_utils:: check_closed_event( & $node, $events, $reason,
1503
1503
$is_check_discard_funding, & $counterparty_node_ids, $channel_capacity) ;
1504
1504
}
1505
1505
}
1506
1506
1507
+ pub fn handle_bump_htlc_event ( node : & Node , count : usize ) {
1508
+ let events = node. chain_monitor . chain_monitor . get_and_clear_pending_events ( ) ;
1509
+ assert_eq ! ( events. len( ) , count) ;
1510
+ for event in events {
1511
+ match event {
1512
+ Event :: BumpTransaction ( bump_event) => {
1513
+ if let BumpTransactionEvent :: HTLCResolution { .. } = & bump_event { }
1514
+ else { panic ! ( ) ; }
1515
+ node. bump_tx_handler . handle_event ( & bump_event) ;
1516
+ } ,
1517
+ _ => panic ! ( ) ,
1518
+ }
1519
+ }
1520
+ }
1521
+
1507
1522
pub fn close_channel < ' a , ' b , ' c > ( outbound_node : & Node < ' a , ' b , ' c > , inbound_node : & Node < ' a , ' b , ' c > , channel_id : & ChannelId , funding_tx : Transaction , close_inbound_first : bool ) -> ( msgs:: ChannelUpdate , msgs:: ChannelUpdate , Transaction ) {
1508
1523
let ( node_a, broadcaster_a, struct_a) = if close_inbound_first { ( & inbound_node. node , & inbound_node. tx_broadcaster , inbound_node) } else { ( & outbound_node. node , & outbound_node. tx_broadcaster , outbound_node) } ;
1509
1524
let ( node_b, broadcaster_b, struct_b) = if close_inbound_first { ( & outbound_node. node , & outbound_node. tx_broadcaster , outbound_node) } else { ( & inbound_node. node , & inbound_node. tx_broadcaster , inbound_node) } ;
0 commit comments