@@ -3907,6 +3907,7 @@ fn test_no_txn_manager_serialize_deserialize() {
3907
3907
3908
3908
#[ test]
3909
3909
fn test_manager_serialize_deserialize_events ( ) {
3910
+ // This test makes sure the events field in ChannelManager survives de/serialization
3910
3911
let chanmon_cfgs = create_chanmon_cfgs ( 2 ) ;
3911
3912
let node_cfgs = create_node_cfgs ( 2 , & chanmon_cfgs) ;
3912
3913
let node_chanmgrs = create_node_chanmgrs ( 2 , & node_cfgs, & [ None , None ] ) ;
@@ -3916,7 +3917,7 @@ fn test_manager_serialize_deserialize_events() {
3916
3917
let nodes_0_deserialized: ChannelManager < EnforcingChannelKeys , & test_utils:: TestChannelMonitor , & test_utils:: TestBroadcaster , & test_utils:: TestKeysInterface , & test_utils:: TestFeeEstimator > ;
3917
3918
let mut nodes = create_network ( 2 , & node_cfgs, & node_chanmgrs) ;
3918
3919
3919
- // Start creating the channel, but stop right before broadcasting the event message FundingBroadcastSafe
3920
+ // Start creating a channel, but stop right before broadcasting the event message FundingBroadcastSafe
3920
3921
let channel_value = 100000 ;
3921
3922
let push_msat = 10001 ;
3922
3923
let a_flags = InitFeatures :: known ( ) ;
@@ -3947,6 +3948,7 @@ fn test_manager_serialize_deserialize_events() {
3947
3948
assert_eq ! ( added_monitors[ 0 ] . 0 , funding_output) ;
3948
3949
added_monitors. clear ( ) ;
3949
3950
}
3951
+ // Normally, this is where node_a would check for a FundingBroadcastSafe event, but the test de/serializes first instead
3950
3952
3951
3953
nodes. push ( node_a) ;
3952
3954
nodes. push ( node_b) ;
@@ -3998,7 +4000,7 @@ fn test_manager_serialize_deserialize_events() {
3998
4000
_ => panic ! ( "Unexpected event" ) ,
3999
4001
} ;
4000
4002
4001
- // Make sure the channel is functioning as thought the de/serialization never happened
4003
+ // Make sure the channel is functioning as though the de/serialization never happened
4002
4004
nodes[ 0 ] . block_notifier . register_listener ( nodes[ 0 ] . node ) ;
4003
4005
assert_eq ! ( nodes[ 0 ] . node. list_channels( ) . len( ) , 1 ) ;
4004
4006
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
0 commit comments