@@ -1211,6 +1211,7 @@ pub struct PaymentFailedConditions<'a> {
1211
1211
pub ( crate ) expected_htlc_error_data : Option < ( u16 , & ' a [ u8 ] ) > ,
1212
1212
pub ( crate ) expected_blamed_scid : Option < u64 > ,
1213
1213
pub ( crate ) expected_blamed_chan_closed : Option < bool > ,
1214
+ pub ( crate ) expected_mpp_parts_remain : bool ,
1214
1215
}
1215
1216
1216
1217
impl < ' a > PaymentFailedConditions < ' a > {
@@ -1219,8 +1220,13 @@ impl<'a> PaymentFailedConditions<'a> {
1219
1220
expected_htlc_error_data : None ,
1220
1221
expected_blamed_scid : None ,
1221
1222
expected_blamed_chan_closed : None ,
1223
+ expected_mpp_parts_remain : false ,
1222
1224
}
1223
1225
}
1226
+ pub fn mpp_parts_remain ( mut self ) -> Self {
1227
+ self . expected_mpp_parts_remain = true ;
1228
+ self
1229
+ }
1224
1230
pub fn blamed_scid ( mut self , scid : u64 ) -> Self {
1225
1231
self . expected_blamed_scid = Some ( scid) ;
1226
1232
self
@@ -1246,9 +1252,7 @@ macro_rules! expect_payment_failed_with_update {
1246
1252
#[ cfg( test) ]
1247
1253
macro_rules! expect_payment_failed {
1248
1254
( $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) ]
1252
1256
let mut conditions = $crate:: ln:: functional_test_utils:: PaymentFailedConditions :: new( ) ;
1253
1257
$(
1254
1258
conditions = conditions. expected_htlc_error_data( $expected_error_code, & $expected_error_data) ;
@@ -1312,18 +1316,6 @@ macro_rules! expect_payment_failed_conditions {
1312
1316
_ => panic!( "Unexpected second event" ) ,
1313
1317
}
1314
1318
}
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
- }
1327
1319
}
1328
1320
}
1329
1321
0 commit comments