@@ -73,9 +73,9 @@ impl Writer for VecWriter {
73
73
}
74
74
}
75
75
76
- struct TestChannelMonitor {
76
+ struct TestChainMonitor {
77
77
pub logger : Arc < dyn Logger > ,
78
- pub simple_monitor : Arc < channelmonitor:: SimpleManyChannelMonitor < OutPoint , EnforcingChannelKeys , Arc < TestBroadcaster > , Arc < FuzzEstimator > , Arc < dyn Logger > > > ,
78
+ pub chain_monitor : Arc < channelmonitor:: ChainMonitor < OutPoint , EnforcingChannelKeys , Arc < TestBroadcaster > , Arc < FuzzEstimator > , Arc < dyn Logger > > > ,
79
79
pub update_ret : Mutex < Result < ( ) , channelmonitor:: ChannelMonitorUpdateErr > > ,
80
80
// If we reload a node with an old copy of ChannelMonitors, the ChannelManager deserialization
81
81
// logic will automatically force-close our channels for us (as we don't have an up-to-date
@@ -85,18 +85,18 @@ struct TestChannelMonitor {
85
85
pub latest_monitors : Mutex < HashMap < OutPoint , ( u64 , Vec < u8 > ) > > ,
86
86
pub should_update_manager : atomic:: AtomicBool ,
87
87
}
88
- impl TestChannelMonitor {
88
+ impl TestChainMonitor {
89
89
pub fn new ( broadcaster : Arc < TestBroadcaster > , logger : Arc < dyn Logger > , feeest : Arc < FuzzEstimator > ) -> Self {
90
90
Self {
91
- simple_monitor : Arc :: new ( channelmonitor:: SimpleManyChannelMonitor :: new ( broadcaster, logger. clone ( ) , feeest) ) ,
91
+ chain_monitor : Arc :: new ( channelmonitor:: ChainMonitor :: new ( broadcaster, logger. clone ( ) , feeest) ) ,
92
92
logger,
93
93
update_ret : Mutex :: new ( Ok ( ( ) ) ) ,
94
94
latest_monitors : Mutex :: new ( HashMap :: new ( ) ) ,
95
95
should_update_manager : atomic:: AtomicBool :: new ( false ) ,
96
96
}
97
97
}
98
98
}
99
- impl chain:: Watch for TestChannelMonitor {
99
+ impl chain:: Watch for TestChainMonitor {
100
100
type Keys = EnforcingChannelKeys ;
101
101
102
102
fn watch_channel ( & self , funding_txo : OutPoint , monitor : channelmonitor:: ChannelMonitor < EnforcingChannelKeys > ) -> Result < ( ) , channelmonitor:: ChannelMonitorUpdateErr > {
@@ -106,7 +106,7 @@ impl chain::Watch for TestChannelMonitor {
106
106
panic ! ( "Already had monitor pre-watch_channel" ) ;
107
107
}
108
108
self . should_update_manager . store ( true , atomic:: Ordering :: Relaxed ) ;
109
- assert ! ( self . simple_monitor . watch_channel( funding_txo, monitor) . is_ok( ) ) ;
109
+ assert ! ( self . chain_monitor . watch_channel( funding_txo, monitor) . is_ok( ) ) ;
110
110
self . update_ret . lock ( ) . unwrap ( ) . clone ( )
111
111
}
112
112
@@ -127,7 +127,7 @@ impl chain::Watch for TestChannelMonitor {
127
127
}
128
128
129
129
fn release_pending_htlc_updates ( & self ) -> Vec < HTLCUpdate > {
130
- return self . simple_monitor . release_pending_htlc_updates ( ) ;
130
+ return self . chain_monitor . release_pending_htlc_updates ( ) ;
131
131
}
132
132
}
133
133
@@ -190,7 +190,7 @@ pub fn do_test<Out: test_logger::Output>(data: &[u8], out: Out) {
190
190
macro_rules! make_node {
191
191
( $node_id: expr) => { {
192
192
let logger: Arc <dyn Logger > = Arc :: new( test_logger:: TestLogger :: new( $node_id. to_string( ) , out. clone( ) ) ) ;
193
- let monitor = Arc :: new( TestChannelMonitor :: new( broadcast. clone( ) , logger. clone( ) , fee_est. clone( ) ) ) ;
193
+ let monitor = Arc :: new( TestChainMonitor :: new( broadcast. clone( ) , logger. clone( ) , fee_est. clone( ) ) ) ;
194
194
195
195
let keys_manager = Arc :: new( KeyProvider { node_id: $node_id, session_id: atomic:: AtomicU8 :: new( 0 ) , channel_id: atomic:: AtomicU8 :: new( 0 ) } ) ;
196
196
let mut config = UserConfig :: default ( ) ;
@@ -205,7 +205,7 @@ pub fn do_test<Out: test_logger::Output>(data: &[u8], out: Out) {
205
205
macro_rules! reload_node {
206
206
( $ser: expr, $node_id: expr, $old_monitors: expr) => { {
207
207
let logger: Arc <dyn Logger > = Arc :: new( test_logger:: TestLogger :: new( $node_id. to_string( ) , out. clone( ) ) ) ;
208
- let chain_monitor = Arc :: new( TestChannelMonitor :: new( broadcast. clone( ) , logger. clone( ) , fee_est. clone( ) ) ) ;
208
+ let chain_monitor = Arc :: new( TestChainMonitor :: new( broadcast. clone( ) , logger. clone( ) , fee_est. clone( ) ) ) ;
209
209
210
210
let keys_manager = Arc :: new( KeyProvider { node_id: $node_id, session_id: atomic:: AtomicU8 :: new( 0 ) , channel_id: atomic:: AtomicU8 :: new( 0 ) } ) ;
211
211
let mut config = UserConfig :: default ( ) ;
@@ -234,7 +234,7 @@ pub fn do_test<Out: test_logger::Output>(data: &[u8], out: Out) {
234
234
channel_monitors: & mut monitor_refs,
235
235
} ;
236
236
237
- ( <( BlockHash , ChannelManager <EnforcingChannelKeys , Arc <TestChannelMonitor >, Arc <TestBroadcaster >, Arc <KeyProvider >, Arc <FuzzEstimator >, Arc <dyn Logger >>) >:: read( & mut Cursor :: new( & $ser. 0 ) , read_args) . expect( "Failed to read manager" ) . 1 , chain_monitor)
237
+ ( <( BlockHash , ChannelManager <EnforcingChannelKeys , Arc <TestChainMonitor >, Arc <TestBroadcaster >, Arc <KeyProvider >, Arc <FuzzEstimator >, Arc <dyn Logger >>) >:: read( & mut Cursor :: new( & $ser. 0 ) , read_args) . expect( "Failed to read manager" ) . 1 , chain_monitor)
238
238
} }
239
239
}
240
240
0 commit comments