@@ -1114,9 +1114,12 @@ macro_rules! expect_payment_failed_with_update {
1114
1114
let events = $node. node. get_and_clear_pending_events( ) ;
1115
1115
assert_eq!( events. len( ) , 1 ) ;
1116
1116
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 , .. } => {
1118
1118
assert_eq!( * payment_hash, $expected_payment_hash, "unexpected payment_hash" ) ;
1119
1119
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" ) ;
1120
1123
assert!( error_code. is_some( ) , "expected error_code.is_some() = true" ) ;
1121
1124
assert!( error_data. is_some( ) , "expected error_data.is_some() = true" ) ;
1122
1125
match network_update {
@@ -1143,9 +1146,12 @@ macro_rules! expect_payment_failed {
1143
1146
let events = $node. node. get_and_clear_pending_events( ) ;
1144
1147
assert_eq!( events. len( ) , 1 ) ;
1145
1148
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 , .. } => {
1147
1150
assert_eq!( * payment_hash, $expected_payment_hash, "unexpected payment_hash" ) ;
1148
1151
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" ) ;
1149
1155
assert!( error_code. is_some( ) , "expected error_code.is_some() = true" ) ;
1150
1156
assert!( error_data. is_some( ) , "expected error_data.is_some() = true" ) ;
1151
1157
$(
0 commit comments