@@ -1114,9 +1114,12 @@ macro_rules! expect_payment_failed_with_update {
11141114 let events = $node. node. get_and_clear_pending_events( ) ;
11151115 assert_eq!( events. len( ) , 1 ) ;
11161116 match events[ 0 ] {
1117- Event :: PaymentPathFailed { ref payment_hash, rejected_by_dest, ref network_update, ref error_code, ref error_data, .. } => {
1117+ Event :: PaymentPathFailed { ref payment_hash, rejected_by_dest, ref network_update, ref error_code, ref error_data, ref path , ref retry , .. } => {
11181118 assert_eq!( * payment_hash, $expected_payment_hash, "unexpected payment_hash" ) ;
11191119 assert_eq!( rejected_by_dest, $rejected_by_dest, "unexpected rejected_by_dest value" ) ;
1120+ assert!( retry. is_some( ) , "expected retry.is_some()" ) ;
1121+ assert_eq!( retry. as_ref( ) . unwrap( ) . final_value_msat, path. last( ) . unwrap( ) . fee_msat, "Retry amount should match last hop in path" ) ;
1122+ assert_eq!( retry. as_ref( ) . unwrap( ) . payee. pubkey, path. last( ) . unwrap( ) . pubkey, "Retry payee node_id should match last hop in path" ) ;
11201123 assert!( error_code. is_some( ) , "expected error_code.is_some() = true" ) ;
11211124 assert!( error_data. is_some( ) , "expected error_data.is_some() = true" ) ;
11221125 match network_update {
@@ -1143,9 +1146,12 @@ macro_rules! expect_payment_failed {
11431146 let events = $node. node. get_and_clear_pending_events( ) ;
11441147 assert_eq!( events. len( ) , 1 ) ;
11451148 match events[ 0 ] {
1146- Event :: PaymentPathFailed { ref payment_hash, rejected_by_dest, network_update: _, ref error_code, ref error_data, .. } => {
1149+ Event :: PaymentPathFailed { ref payment_hash, rejected_by_dest, network_update: _, ref error_code, ref error_data, ref path , ref retry , .. } => {
11471150 assert_eq!( * payment_hash, $expected_payment_hash, "unexpected payment_hash" ) ;
11481151 assert_eq!( rejected_by_dest, $rejected_by_dest, "unexpected rejected_by_dest value" ) ;
1152+ assert!( retry. is_some( ) , "expected retry.is_some()" ) ;
1153+ assert_eq!( retry. as_ref( ) . unwrap( ) . final_value_msat, path. last( ) . unwrap( ) . fee_msat, "Retry amount should match last hop in path" ) ;
1154+ assert_eq!( retry. as_ref( ) . unwrap( ) . payee. pubkey, path. last( ) . unwrap( ) . pubkey, "Retry payee node_id should match last hop in path" ) ;
11491155 assert!( error_code. is_some( ) , "expected error_code.is_some() = true" ) ;
11501156 assert!( error_data. is_some( ) , "expected error_data.is_some() = true" ) ;
11511157 $(
0 commit comments