@@ -31,7 +31,7 @@ use crate::ln::msgs;
31
31
use crate :: ln:: msgs:: { ChannelMessageHandler , RoutingMessageHandler , ErrorAction } ;
32
32
use crate :: util:: enforcing_trait_impls:: EnforcingSigner ;
33
33
use crate :: util:: test_utils;
34
- use crate :: util:: events:: { Event , Failure , MessageSendEvent , MessageSendEventsProvider , PaymentPurpose , ClosureReason , HTLCDestination } ;
34
+ use crate :: util:: events:: { Event , MessageSendEvent , MessageSendEventsProvider , PathFailure , PaymentPurpose , ClosureReason , HTLCDestination } ;
35
35
use crate :: util:: errors:: APIError ;
36
36
use crate :: util:: ser:: { Writeable , ReadableArgs } ;
37
37
use crate :: util:: config:: UserConfig ;
@@ -3240,7 +3240,7 @@ fn do_test_commitment_revoked_fail_backward_exhaustive(deliver_bs_raa: bool, use
3240
3240
// If we delivered B's RAA we got an unknown preimage error, not something
3241
3241
// that we should update our routing table for.
3242
3242
if !deliver_bs_raa {
3243
- if let Failure :: OnPath { network_update : Some ( _) } = failure { } else { panic ! ( "Unexpected path failure" ) }
3243
+ if let PathFailure :: OnPath { network_update : Some ( _) } = failure { } else { panic ! ( "Unexpected path failure" ) }
3244
3244
}
3245
3245
} ,
3246
3246
_ => panic ! ( "Unexpected event" ) ,
@@ -3252,7 +3252,7 @@ fn do_test_commitment_revoked_fail_backward_exhaustive(deliver_bs_raa: bool, use
3252
3252
_ => panic ! ( "Unexpected event" ) ,
3253
3253
}
3254
3254
match events[ 2 ] {
3255
- Event :: PaymentPathFailed { ref payment_hash, failure : Failure :: OnPath { network_update : Some ( _) } , .. } => {
3255
+ Event :: PaymentPathFailed { ref payment_hash, failure : PathFailure :: OnPath { network_update : Some ( _) } , .. } => {
3256
3256
assert ! ( failed_htlcs. insert( payment_hash. 0 ) ) ;
3257
3257
} ,
3258
3258
_ => panic ! ( "Unexpected event" ) ,
@@ -3264,7 +3264,7 @@ fn do_test_commitment_revoked_fail_backward_exhaustive(deliver_bs_raa: bool, use
3264
3264
_ => panic ! ( "Unexpected event" ) ,
3265
3265
}
3266
3266
match events[ 4 ] {
3267
- Event :: PaymentPathFailed { ref payment_hash, failure : Failure :: OnPath { network_update : Some ( _) } , .. } => {
3267
+ Event :: PaymentPathFailed { ref payment_hash, failure : PathFailure :: OnPath { network_update : Some ( _) } , .. } => {
3268
3268
assert ! ( failed_htlcs. insert( payment_hash. 0 ) ) ;
3269
3269
} ,
3270
3270
_ => panic ! ( "Unexpected event" ) ,
@@ -5153,7 +5153,7 @@ fn do_test_fail_backwards_unrevoked_remote_announce(deliver_last_raa: bool, anno
5153
5153
} else {
5154
5154
assert ! ( !payment_failed_permanently) ;
5155
5155
}
5156
- if let Failure :: OnPath { network_update : Some ( _) } = failure {
5156
+ if let PathFailure :: OnPath { network_update : Some ( _) } = failure {
5157
5157
as_updates += 1 ;
5158
5158
}
5159
5159
} else if let & Event :: PaymentFailed { .. } = event {
@@ -5179,7 +5179,7 @@ fn do_test_fail_backwards_unrevoked_remote_announce(deliver_last_raa: bool, anno
5179
5179
} else {
5180
5180
assert ! ( !payment_failed_permanently) ;
5181
5181
}
5182
- if let Failure :: OnPath { network_update : Some ( _) } = failure {
5182
+ if let PathFailure :: OnPath { network_update : Some ( _) } = failure {
5183
5183
bs_updates += 1 ;
5184
5184
}
5185
5185
} else if let & Event :: PaymentFailed { .. } = event {
@@ -5693,7 +5693,7 @@ fn test_fail_holding_cell_htlc_upon_free() {
5693
5693
let events = nodes[ 0 ] . node . get_and_clear_pending_events ( ) ;
5694
5694
assert_eq ! ( events. len( ) , 2 ) ;
5695
5695
match & events[ 0 ] {
5696
- & Event :: PaymentPathFailed { ref payment_id, ref payment_hash, ref payment_failed_permanently, failure : Failure :: OnPath { network_update : None } , ref short_channel_id, .. } => {
5696
+ & Event :: PaymentPathFailed { ref payment_id, ref payment_hash, ref payment_failed_permanently, failure : PathFailure :: OnPath { network_update : None } , ref short_channel_id, .. } => {
5697
5697
assert_eq ! ( PaymentId ( our_payment_hash. 0 ) , * payment_id. as_ref( ) . unwrap( ) ) ;
5698
5698
assert_eq ! ( our_payment_hash. clone( ) , * payment_hash) ;
5699
5699
assert_eq ! ( * payment_failed_permanently, false ) ;
@@ -5782,7 +5782,7 @@ fn test_free_and_fail_holding_cell_htlcs() {
5782
5782
let events = nodes[ 0 ] . node . get_and_clear_pending_events ( ) ;
5783
5783
assert_eq ! ( events. len( ) , 2 ) ;
5784
5784
match & events[ 0 ] {
5785
- & Event :: PaymentPathFailed { ref payment_id, ref payment_hash, ref payment_failed_permanently, failure : Failure :: OnPath { network_update : None } , ref short_channel_id, .. } => {
5785
+ & Event :: PaymentPathFailed { ref payment_id, ref payment_hash, ref payment_failed_permanently, failure : PathFailure :: OnPath { network_update : None } , ref short_channel_id, .. } => {
5786
5786
assert_eq ! ( payment_id_2, * payment_id. as_ref( ) . unwrap( ) ) ;
5787
5787
assert_eq ! ( payment_hash_2. clone( ) , * payment_hash) ;
5788
5788
assert_eq ! ( * payment_failed_permanently, false ) ;
@@ -6683,7 +6683,7 @@ fn test_channel_failed_after_message_with_badonion_node_perm_bits_set() {
6683
6683
// Expect a PaymentPathFailed event with a ChannelFailure network update for the channel between
6684
6684
// the node originating the error to its next hop.
6685
6685
match events_5[ 0 ] {
6686
- Event :: PaymentPathFailed { error_code, failure : Failure :: OnPath { network_update : Some ( NetworkUpdate :: ChannelFailure { short_channel_id, is_permanent } ) } , ..
6686
+ Event :: PaymentPathFailed { error_code, failure : PathFailure :: OnPath { network_update : Some ( NetworkUpdate :: ChannelFailure { short_channel_id, is_permanent } ) } , ..
6687
6687
} => {
6688
6688
assert_eq ! ( short_channel_id, chan_2. 0 . contents. short_channel_id) ;
6689
6689
assert ! ( is_permanent) ;
0 commit comments