@@ -524,8 +524,8 @@ impl<'a> TestChainMonitor<'a> {
524
524
blocker. recv ( ) . unwrap ( ) ;
525
525
}
526
526
527
- // At every point where we get a monitor update, we should be able to send a useful monitor
528
- // to a watchtower and disk.. .
527
+ // Test that a monitor survives a round-trip, and use the round-tripped monitor in the
528
+ // underlying `ChainMonitor` .
529
529
let mut w = TestVecWriter ( Vec :: new ( ) ) ;
530
530
monitor. write ( & mut w) . unwrap ( ) ;
531
531
let new_monitor = <( BlockHash , ChannelMonitor < TestChannelSigner > ) >:: read (
@@ -536,7 +536,8 @@ impl<'a> TestChainMonitor<'a> {
536
536
. 1 ;
537
537
// Note that a ChannelMonitor might not round-trip exactly here as we have tests that were
538
538
// serialized prior to LDK 0.1 and re-serializing them will flip the "written after LDK
539
- // 0.1" flag.
539
+ // 0.1" flag. Thus, unlike the code in `watch_channel` below, we do not assert that the
540
+ // monitor is the same after a serialization round-trip.
540
541
self . latest_monitor_update_id
541
542
. lock ( )
542
543
. unwrap ( )
@@ -555,7 +556,8 @@ impl<'a> chain::Watch<TestChannelSigner> for TestChainMonitor<'a> {
555
556
}
556
557
557
558
// At every point where we get a monitor update, we should be able to send a useful monitor
558
- // to a watchtower and disk...
559
+ // to a watchtower and disk. At a minimum, this means we should be able to round-trip the
560
+ // monitor to a serialized copy and get he same one back.
559
561
let mut w = TestVecWriter ( Vec :: new ( ) ) ;
560
562
monitor. write ( & mut w) . unwrap ( ) ;
561
563
let new_monitor = <( BlockHash , ChannelMonitor < TestChannelSigner > ) >:: read (
0 commit comments