@@ -4083,7 +4083,7 @@ fn do_test_htlc_timeout(send_partial_mpp: bool) {
40834083 let cur_height = CHAN_CONFIRM_DEPTH + 1 ; // route_payment calls send_payment, which adds 1 to the current height. So we do the same here to match.
40844084 let payment_id = PaymentId ( [ 42 ; 32 ] ) ;
40854085 let session_privs = nodes[ 0 ] . node . test_add_new_pending_payment ( our_payment_hash, Some ( payment_secret) , payment_id, & route) . unwrap ( ) ;
4086- nodes[ 0 ] . node . send_payment_along_path ( & route. paths [ 0 ] , & route. payment_params , & our_payment_hash, & Some ( payment_secret) , 200_000 , cur_height, payment_id, & None , session_privs[ 0 ] ) . unwrap ( ) ;
4086+ nodes[ 0 ] . node . test_send_payment_along_path ( & route. paths [ 0 ] , & route. payment_params , & our_payment_hash, & Some ( payment_secret) , 200_000 , cur_height, payment_id, & None , session_privs[ 0 ] ) . unwrap ( ) ;
40874087 check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
40884088 let mut events = nodes[ 0 ] . node . get_and_clear_pending_msg_events ( ) ;
40894089 assert_eq ! ( events. len( ) , 1 ) ;
@@ -8150,12 +8150,13 @@ fn test_update_err_monitor_lockdown() {
81508150 let logger = test_utils:: TestLogger :: with_id ( format ! ( "node {}" , 0 ) ) ;
81518151 let persister = test_utils:: TestPersister :: new ( ) ;
81528152 let watchtower = {
8153- let monitor = nodes[ 0 ] . chain_monitor . chain_monitor . get_monitor ( outpoint) . unwrap ( ) ;
8154- let mut w = test_utils:: TestVecWriter ( Vec :: new ( ) ) ;
8155- monitor. write ( & mut w) . unwrap ( ) ;
8156- let new_monitor = <( BlockHash , channelmonitor:: ChannelMonitor < EnforcingSigner > ) >:: read (
8157- & mut io:: Cursor :: new ( & w. 0 ) , ( nodes[ 0 ] . keys_manager , nodes[ 0 ] . keys_manager ) ) . unwrap ( ) . 1 ;
8158- assert ! ( new_monitor == * monitor) ;
8153+ let new_monitor = {
8154+ let monitor = nodes[ 0 ] . chain_monitor . chain_monitor . get_monitor ( outpoint) . unwrap ( ) ;
8155+ let new_monitor = <( BlockHash , channelmonitor:: ChannelMonitor < EnforcingSigner > ) >:: read (
8156+ & mut io:: Cursor :: new ( & monitor. encode ( ) ) , ( nodes[ 0 ] . keys_manager , nodes[ 0 ] . keys_manager ) ) . unwrap ( ) . 1 ;
8157+ assert ! ( new_monitor == * monitor) ;
8158+ new_monitor
8159+ } ;
81598160 let watchtower = test_utils:: TestChainMonitor :: new ( Some ( & chain_source) , & chanmon_cfgs[ 0 ] . tx_broadcaster , & logger, & chanmon_cfgs[ 0 ] . fee_estimator , & persister, & node_cfgs[ 0 ] . keys_manager ) ;
81608161 assert_eq ! ( watchtower. watch_channel( outpoint, new_monitor) , ChannelMonitorUpdateStatus :: Completed ) ;
81618162 watchtower
@@ -8217,12 +8218,13 @@ fn test_concurrent_monitor_claim() {
82178218 let logger = test_utils:: TestLogger :: with_id ( format ! ( "node {}" , "Alice" ) ) ;
82188219 let persister = test_utils:: TestPersister :: new ( ) ;
82198220 let watchtower_alice = {
8220- let monitor = nodes[ 0 ] . chain_monitor . chain_monitor . get_monitor ( outpoint) . unwrap ( ) ;
8221- let mut w = test_utils:: TestVecWriter ( Vec :: new ( ) ) ;
8222- monitor. write ( & mut w) . unwrap ( ) ;
8223- let new_monitor = <( BlockHash , channelmonitor:: ChannelMonitor < EnforcingSigner > ) >:: read (
8224- & mut io:: Cursor :: new ( & w. 0 ) , ( nodes[ 0 ] . keys_manager , nodes[ 0 ] . keys_manager ) ) . unwrap ( ) . 1 ;
8225- assert ! ( new_monitor == * monitor) ;
8221+ let new_monitor = {
8222+ let monitor = nodes[ 0 ] . chain_monitor . chain_monitor . get_monitor ( outpoint) . unwrap ( ) ;
8223+ let new_monitor = <( BlockHash , channelmonitor:: ChannelMonitor < EnforcingSigner > ) >:: read (
8224+ & mut io:: Cursor :: new ( & monitor. encode ( ) ) , ( nodes[ 0 ] . keys_manager , nodes[ 0 ] . keys_manager ) ) . unwrap ( ) . 1 ;
8225+ assert ! ( new_monitor == * monitor) ;
8226+ new_monitor
8227+ } ;
82268228 let watchtower = test_utils:: TestChainMonitor :: new ( Some ( & chain_source) , & chanmon_cfgs[ 0 ] . tx_broadcaster , & logger, & chanmon_cfgs[ 0 ] . fee_estimator , & persister, & node_cfgs[ 0 ] . keys_manager ) ;
82278229 assert_eq ! ( watchtower. watch_channel( outpoint, new_monitor) , ChannelMonitorUpdateStatus :: Completed ) ;
82288230 watchtower
@@ -8246,12 +8248,13 @@ fn test_concurrent_monitor_claim() {
82468248 let logger = test_utils:: TestLogger :: with_id ( format ! ( "node {}" , "Bob" ) ) ;
82478249 let persister = test_utils:: TestPersister :: new ( ) ;
82488250 let watchtower_bob = {
8249- let monitor = nodes[ 0 ] . chain_monitor . chain_monitor . get_monitor ( outpoint) . unwrap ( ) ;
8250- let mut w = test_utils:: TestVecWriter ( Vec :: new ( ) ) ;
8251- monitor. write ( & mut w) . unwrap ( ) ;
8252- let new_monitor = <( BlockHash , channelmonitor:: ChannelMonitor < EnforcingSigner > ) >:: read (
8253- & mut io:: Cursor :: new ( & w. 0 ) , ( nodes[ 0 ] . keys_manager , nodes[ 0 ] . keys_manager ) ) . unwrap ( ) . 1 ;
8254- assert ! ( new_monitor == * monitor) ;
8251+ let new_monitor = {
8252+ let monitor = nodes[ 0 ] . chain_monitor . chain_monitor . get_monitor ( outpoint) . unwrap ( ) ;
8253+ let new_monitor = <( BlockHash , channelmonitor:: ChannelMonitor < EnforcingSigner > ) >:: read (
8254+ & mut io:: Cursor :: new ( & monitor. encode ( ) ) , ( nodes[ 0 ] . keys_manager , nodes[ 0 ] . keys_manager ) ) . unwrap ( ) . 1 ;
8255+ assert ! ( new_monitor == * monitor) ;
8256+ new_monitor
8257+ } ;
82558258 let watchtower = test_utils:: TestChainMonitor :: new ( Some ( & chain_source) , & chanmon_cfgs[ 0 ] . tx_broadcaster , & logger, & chanmon_cfgs[ 0 ] . fee_estimator , & persister, & node_cfgs[ 0 ] . keys_manager ) ;
82568259 assert_eq ! ( watchtower. watch_channel( outpoint, new_monitor) , ChannelMonitorUpdateStatus :: Completed ) ;
82578260 watchtower
@@ -9141,20 +9144,20 @@ fn test_inconsistent_mpp_params() {
91419144 dup_route. paths . push ( route. paths [ 1 ] . clone ( ) ) ;
91429145 nodes[ 0 ] . node . test_add_new_pending_payment ( our_payment_hash, Some ( our_payment_secret) , payment_id, & dup_route) . unwrap ( )
91439146 } ;
9144- {
9145- nodes[ 0 ] . node . send_payment_along_path ( & route. paths [ 0 ] , & payment_params_opt, & our_payment_hash, & Some ( our_payment_secret) , 15_000_000 , cur_height, payment_id, & None , session_privs[ 0 ] ) . unwrap ( ) ;
9146- check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
9147+ nodes[ 0 ] . node . test_send_payment_along_path ( & route. paths [ 0 ] , & payment_params_opt, & our_payment_hash, & Some ( our_payment_secret) , 15_000_000 , cur_height, payment_id, & None , session_privs[ 0 ] ) . unwrap ( ) ;
9148+ check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
91479149
9150+ {
91489151 let mut events = nodes[ 0 ] . node . get_and_clear_pending_msg_events ( ) ;
91499152 assert_eq ! ( events. len( ) , 1 ) ;
91509153 pass_along_path ( & nodes[ 0 ] , & [ & nodes[ 1 ] , & nodes[ 3 ] ] , 15_000_000 , our_payment_hash, Some ( our_payment_secret) , events. pop ( ) . unwrap ( ) , false , None ) ;
91519154 }
91529155 assert ! ( nodes[ 3 ] . node. get_and_clear_pending_events( ) . is_empty( ) ) ;
91539156
9154- {
9155- nodes[ 0 ] . node . send_payment_along_path ( & route. paths [ 1 ] , & payment_params_opt, & our_payment_hash, & Some ( our_payment_secret) , 14_000_000 , cur_height, payment_id, & None , session_privs[ 1 ] ) . unwrap ( ) ;
9156- check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
9157+ nodes[ 0 ] . node . test_send_payment_along_path ( & route. paths [ 1 ] , & payment_params_opt, & our_payment_hash, & Some ( our_payment_secret) , 14_000_000 , cur_height, payment_id, & None , session_privs[ 1 ] ) . unwrap ( ) ;
9158+ check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
91579159
9160+ {
91589161 let mut events = nodes[ 0 ] . node . get_and_clear_pending_msg_events ( ) ;
91599162 assert_eq ! ( events. len( ) , 1 ) ;
91609163 let payment_event = SendEvent :: from_event ( events. pop ( ) . unwrap ( ) ) ;
@@ -9197,7 +9200,7 @@ fn test_inconsistent_mpp_params() {
91979200
91989201 expect_payment_failed_conditions ( & nodes[ 0 ] , our_payment_hash, true , PaymentFailedConditions :: new ( ) . mpp_parts_remain ( ) ) ;
91999202
9200- nodes[ 0 ] . node . send_payment_along_path ( & route. paths [ 1 ] , & payment_params_opt, & our_payment_hash, & Some ( our_payment_secret) , 15_000_000 , cur_height, payment_id, & None , session_privs[ 2 ] ) . unwrap ( ) ;
9203+ nodes[ 0 ] . node . test_send_payment_along_path ( & route. paths [ 1 ] , & payment_params_opt, & our_payment_hash, & Some ( our_payment_secret) , 15_000_000 , cur_height, payment_id, & None , session_privs[ 2 ] ) . unwrap ( ) ;
92019204 check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
92029205
92039206 let mut events = nodes[ 0 ] . node . get_and_clear_pending_msg_events ( ) ;
0 commit comments