@@ -1211,6 +1211,7 @@ pub struct PaymentFailedConditions<'a> {
12111211 pub ( crate ) expected_htlc_error_data : Option < ( u16 , & ' a [ u8 ] ) > ,
12121212 pub ( crate ) expected_blamed_scid : Option < u64 > ,
12131213 pub ( crate ) expected_blamed_chan_closed : Option < bool > ,
1214+ pub ( crate ) expected_mpp_parts_remain : bool ,
12141215}
12151216
12161217impl < ' a > PaymentFailedConditions < ' a > {
@@ -1219,8 +1220,13 @@ impl<'a> PaymentFailedConditions<'a> {
12191220 expected_htlc_error_data : None ,
12201221 expected_blamed_scid : None ,
12211222 expected_blamed_chan_closed : None ,
1223+ expected_mpp_parts_remain : false ,
12221224 }
12231225 }
1226+ pub fn mpp_parts_remain ( mut self ) -> Self {
1227+ self . expected_mpp_parts_remain = true ;
1228+ self
1229+ }
12241230 pub fn blamed_scid ( mut self , scid : u64 ) -> Self {
12251231 self . expected_blamed_scid = Some ( scid) ;
12261232 self
@@ -1246,9 +1252,7 @@ macro_rules! expect_payment_failed_with_update {
12461252#[ cfg( test) ]
12471253macro_rules! expect_payment_failed {
12481254 ( $node: expr, $expected_payment_hash: expr, $rejected_by_dest: expr $( , $expected_error_code: expr, $expected_error_data: expr) * ) => {
1249- expect_payment_failed!( $node, $expected_payment_hash, $rejected_by_dest, false $( , $expected_error_code, $expected_error_data) * ) ;
1250- } ;
1251- ( $node: expr, $expected_payment_hash: expr, $rejected_by_dest: expr, $mpp_parts_remain: expr $( , $expected_error_code: expr, $expected_error_data: expr) * ) => {
1255+ #[ allow( unused_mut) ]
12521256 let mut conditions = $crate:: ln:: functional_test_utils:: PaymentFailedConditions :: new( ) ;
12531257 $(
12541258 conditions = conditions. expected_htlc_error_data( $expected_error_code, & $expected_error_data) ;
@@ -1312,18 +1316,6 @@ macro_rules! expect_payment_failed_conditions {
13121316 _ => panic!( "Unexpected second event" ) ,
13131317 }
13141318 }
1315- if !$mpp_parts_remain {
1316- $node. node. no_further_payment_retries( our_payment_id) ;
1317- let events = $node. node. get_and_clear_pending_events( ) ;
1318- assert_eq!( events. len( ) , 1 ) ;
1319- match events[ 0 ] {
1320- Event :: PaymentFailed { ref payment_hash, ref payment_id } => {
1321- assert_eq!( * payment_hash, $expected_payment_hash, "unexpected second payment_hash" ) ;
1322- assert_eq!( * payment_id, our_payment_id) ;
1323- }
1324- _ => panic!( "Unexpected second event" ) ,
1325- }
1326- }
13271319 }
13281320}
13291321
0 commit comments