@@ -418,7 +418,7 @@ fn test_onion_failure() {
418
418
let onion_keys = onion_utils:: construct_onion_keys ( & Secp256k1 :: new ( ) , & route. paths [ 0 ] , & session_priv) . unwrap ( ) ;
419
419
let failure = onion_utils:: build_first_hop_failure_packet ( onion_keys[ 0 ] . shared_secret . as_ref ( ) , NODE |2 , & [ 0 ; 0 ] ) ;
420
420
msg. reason = failure. data ;
421
- msg. attribution_data = Some ( failure. attribution_data ) ;
421
+ msg. attribution_data = failure. attribution_data ;
422
422
} , ||{ } , true , Some ( NODE |2 ) , Some ( NetworkUpdate :: NodeFailure { node_id : route. paths [ 0 ] . hops [ 0 ] . pubkey , is_permanent : false } ) , Some ( route. paths [ 0 ] . hops [ 0 ] . short_channel_id ) , Some ( next_hop_failure. clone ( ) ) ) ;
423
423
424
424
// final node failure
@@ -428,7 +428,7 @@ fn test_onion_failure() {
428
428
let onion_keys = onion_utils:: construct_onion_keys ( & Secp256k1 :: new ( ) , & route. paths [ 0 ] , & session_priv) . unwrap ( ) ;
429
429
let failure = onion_utils:: build_first_hop_failure_packet ( onion_keys[ 1 ] . shared_secret . as_ref ( ) , NODE |2 , & [ 0 ; 0 ] ) ;
430
430
msg. reason = failure. data ;
431
- msg. attribution_data = Some ( failure. attribution_data ) ;
431
+ msg. attribution_data = failure. attribution_data ;
432
432
} , ||{
433
433
nodes[ 2 ] . node . fail_htlc_backwards ( & payment_hash) ;
434
434
} , true , Some ( NODE |2 ) , Some ( NetworkUpdate :: NodeFailure { node_id : route. paths [ 0 ] . hops [ 1 ] . pubkey , is_permanent : false } ) , Some ( route. paths [ 0 ] . hops [ 1 ] . short_channel_id ) , None ) ;
@@ -442,7 +442,7 @@ fn test_onion_failure() {
442
442
let onion_keys = onion_utils:: construct_onion_keys ( & Secp256k1 :: new ( ) , & route. paths [ 0 ] , & session_priv) . unwrap ( ) ;
443
443
let failure = onion_utils:: build_first_hop_failure_packet ( onion_keys[ 0 ] . shared_secret . as_ref ( ) , PERM |NODE |2 , & [ 0 ; 0 ] ) ;
444
444
msg. reason = failure. data ;
445
- msg. attribution_data = Some ( failure. attribution_data ) ;
445
+ msg. attribution_data = failure. attribution_data ;
446
446
} , ||{ } , true , Some ( PERM |NODE |2 ) , Some ( NetworkUpdate :: NodeFailure { node_id : route. paths [ 0 ] . hops [ 0 ] . pubkey , is_permanent : true } ) , Some ( route. paths [ 0 ] . hops [ 0 ] . short_channel_id ) , Some ( next_hop_failure. clone ( ) ) ) ;
447
447
448
448
// final node failure
@@ -451,7 +451,7 @@ fn test_onion_failure() {
451
451
let onion_keys = onion_utils:: construct_onion_keys ( & Secp256k1 :: new ( ) , & route. paths [ 0 ] , & session_priv) . unwrap ( ) ;
452
452
let failure = onion_utils:: build_first_hop_failure_packet ( onion_keys[ 1 ] . shared_secret . as_ref ( ) , PERM |NODE |2 , & [ 0 ; 0 ] ) ;
453
453
msg. reason = failure. data ;
454
- msg. attribution_data = Some ( failure. attribution_data ) ;
454
+ msg. attribution_data = failure. attribution_data ;
455
455
} , ||{
456
456
nodes[ 2 ] . node . fail_htlc_backwards ( & payment_hash) ;
457
457
} , false , Some ( PERM |NODE |2 ) , Some ( NetworkUpdate :: NodeFailure { node_id : route. paths [ 0 ] . hops [ 1 ] . pubkey , is_permanent : true } ) , Some ( route. paths [ 0 ] . hops [ 1 ] . short_channel_id ) , None ) ;
@@ -465,7 +465,7 @@ fn test_onion_failure() {
465
465
let onion_keys = onion_utils:: construct_onion_keys ( & Secp256k1 :: new ( ) , & route. paths [ 0 ] , & session_priv) . unwrap ( ) ;
466
466
let failure = onion_utils:: build_first_hop_failure_packet ( onion_keys[ 0 ] . shared_secret . as_ref ( ) , PERM |NODE |3 , & [ 0 ; 0 ] ) ;
467
467
msg. reason = failure. data ;
468
- msg. attribution_data = Some ( failure. attribution_data ) ;
468
+ msg. attribution_data = failure. attribution_data ;
469
469
} , ||{
470
470
nodes[ 2 ] . node . fail_htlc_backwards ( & payment_hash) ;
471
471
} , true , Some ( PERM |NODE |3 ) , Some ( NetworkUpdate :: NodeFailure { node_id : route. paths [ 0 ] . hops [ 0 ] . pubkey , is_permanent : true } ) , Some ( route. paths [ 0 ] . hops [ 0 ] . short_channel_id ) , Some ( next_hop_failure. clone ( ) ) ) ;
@@ -476,7 +476,7 @@ fn test_onion_failure() {
476
476
let onion_keys = onion_utils:: construct_onion_keys ( & Secp256k1 :: new ( ) , & route. paths [ 0 ] , & session_priv) . unwrap ( ) ;
477
477
let failure = onion_utils:: build_first_hop_failure_packet ( onion_keys[ 1 ] . shared_secret . as_ref ( ) , PERM |NODE |3 , & [ 0 ; 0 ] ) ;
478
478
msg. reason = failure. data ;
479
- msg. attribution_data = Some ( failure. attribution_data ) ;
479
+ msg. attribution_data = failure. attribution_data ;
480
480
} , ||{
481
481
nodes[ 2 ] . node . fail_htlc_backwards ( & payment_hash) ;
482
482
} , false , Some ( PERM |NODE |3 ) , Some ( NetworkUpdate :: NodeFailure { node_id : route. paths [ 0 ] . hops [ 1 ] . pubkey , is_permanent : true } ) , Some ( route. paths [ 0 ] . hops [ 1 ] . short_channel_id ) , None ) ;
@@ -508,7 +508,7 @@ fn test_onion_failure() {
508
508
let onion_keys = onion_utils:: construct_onion_keys ( & Secp256k1 :: new ( ) , & route. paths [ 0 ] , & session_priv) . unwrap ( ) ;
509
509
let failure = onion_utils:: build_first_hop_failure_packet ( onion_keys[ 0 ] . shared_secret . as_ref ( ) , UPDATE |7 , & err_data) ;
510
510
msg. reason = failure. data ;
511
- msg. attribution_data = Some ( failure. attribution_data ) ;
511
+ msg. attribution_data = failure. attribution_data ;
512
512
} , ||{ } , true , Some ( UPDATE |7 ) ,
513
513
Some ( NetworkUpdate :: ChannelFailure { short_channel_id, is_permanent : false } ) ,
514
514
Some ( short_channel_id) , Some ( next_hop_failure. clone ( ) ) ) ;
@@ -522,7 +522,7 @@ fn test_onion_failure() {
522
522
let onion_keys = onion_utils:: construct_onion_keys ( & Secp256k1 :: new ( ) , & route. paths [ 0 ] , & session_priv) . unwrap ( ) ;
523
523
let failure = onion_utils:: build_first_hop_failure_packet ( onion_keys[ 0 ] . shared_secret . as_ref ( ) , UPDATE |7 , & err_data_without_type) ;
524
524
msg. reason = failure. data ;
525
- msg. attribution_data = Some ( failure. attribution_data ) ;
525
+ msg. attribution_data = failure. attribution_data ;
526
526
} , ||{ } , true , Some ( UPDATE |7 ) ,
527
527
Some ( NetworkUpdate :: ChannelFailure { short_channel_id, is_permanent : false } ) ,
528
528
Some ( short_channel_id) , Some ( next_hop_failure. clone ( ) ) ) ;
@@ -535,7 +535,7 @@ fn test_onion_failure() {
535
535
let onion_keys = onion_utils:: construct_onion_keys ( & Secp256k1 :: new ( ) , & route. paths [ 0 ] , & session_priv) . unwrap ( ) ;
536
536
let failure = onion_utils:: build_first_hop_failure_packet ( onion_keys[ 0 ] . shared_secret . as_ref ( ) , PERM |8 , & [ 0 ; 0 ] ) ;
537
537
msg. reason = failure. data ;
538
- msg. attribution_data = Some ( failure. attribution_data ) ;
538
+ msg. attribution_data = failure. attribution_data ;
539
539
// short_channel_id from the processing node
540
540
} , ||{ } , true , Some ( PERM |8 ) , Some ( NetworkUpdate :: ChannelFailure { short_channel_id, is_permanent : true } ) , Some ( short_channel_id) , Some ( next_hop_failure. clone ( ) ) ) ;
541
541
@@ -547,7 +547,7 @@ fn test_onion_failure() {
547
547
let onion_keys = onion_utils:: construct_onion_keys ( & Secp256k1 :: new ( ) , & route. paths [ 0 ] , & session_priv) . unwrap ( ) ;
548
548
let failure = onion_utils:: build_first_hop_failure_packet ( onion_keys[ 0 ] . shared_secret . as_ref ( ) , PERM |9 , & [ 0 ; 0 ] ) ;
549
549
msg. reason = failure. data ;
550
- msg. attribution_data = Some ( failure. attribution_data ) ;
550
+ msg. attribution_data = failure. attribution_data ;
551
551
// short_channel_id from the processing node
552
552
} , ||{ } , true , Some ( PERM |9 ) , Some ( NetworkUpdate :: ChannelFailure { short_channel_id, is_permanent : true } ) , Some ( short_channel_id) , Some ( next_hop_failure. clone ( ) ) ) ;
553
553
@@ -681,7 +681,7 @@ fn test_onion_failure() {
681
681
let onion_keys = onion_utils:: construct_onion_keys ( & Secp256k1 :: new ( ) , & route. paths [ 0 ] , & session_priv) . unwrap ( ) ;
682
682
let failure = onion_utils:: build_first_hop_failure_packet ( onion_keys[ 1 ] . shared_secret . as_ref ( ) , 23 , & [ 0 ; 0 ] ) ;
683
683
msg. reason = failure. data ;
684
- msg. attribution_data = Some ( failure. attribution_data ) ;
684
+ msg. attribution_data = failure. attribution_data ;
685
685
} , ||{
686
686
nodes[ 2 ] . node . fail_htlc_backwards ( & payment_hash) ;
687
687
} , true , Some ( 23 ) , None , None , None ) ;
@@ -701,12 +701,12 @@ fn test_onion_failure() {
701
701
decoded_err_packet. hmac = Hmac :: from_engine ( hmac) . to_byte_array ( ) ;
702
702
let onion_error = OnionErrorPacket {
703
703
data : decoded_err_packet. encode ( ) ,
704
- attribution_data : [ 0 ; ATTRIBUTION_DATA_LEN ] ,
704
+ attribution_data : Some ( [ 0 ; ATTRIBUTION_DATA_LEN ] ) ,
705
705
} ;
706
706
let failure = onion_utils:: encrypt_failure_packet (
707
707
& onion_keys[ 1 ] . shared_secret . as_ref ( ) , & onion_error) ;
708
708
msg. reason = failure. data ;
709
- msg. attribution_data = Some ( failure. attribution_data ) ;
709
+ msg. attribution_data = failure. attribution_data ;
710
710
} , || nodes[ 2 ] . node . fail_htlc_backwards ( & payment_hash) , false , None ,
711
711
Some ( NetworkUpdate :: NodeFailure { node_id : route. paths [ 0 ] . hops [ 1 ] . pubkey , is_permanent : true } ) ,
712
712
Some ( channels[ 1 ] . 0 . contents . short_channel_id ) , None ) ;
@@ -730,7 +730,7 @@ fn test_onion_failure() {
730
730
decoded_err_packet. hmac = Hmac :: from_engine ( hmac) . to_byte_array ( ) ;
731
731
let onion_error = OnionErrorPacket {
732
732
data : decoded_err_packet. encode ( ) ,
733
- attribution_data : [ 0 ; ATTRIBUTION_DATA_LEN ] ,
733
+ attribution_data : Some ( [ 0 ; ATTRIBUTION_DATA_LEN ] ) ,
734
734
} ;
735
735
let failure = onion_utils:: encrypt_failure_packet (
736
736
& onion_keys[ 0 ] . shared_secret . as_ref ( ) , & onion_error) ;
@@ -758,7 +758,7 @@ fn test_onion_failure() {
758
758
decoded_err_packet. hmac = Hmac :: from_engine ( hmac) . to_byte_array ( ) ;
759
759
let onion_error = OnionErrorPacket {
760
760
data : decoded_err_packet. encode ( ) ,
761
- attribution_data : [ 0 ; ATTRIBUTION_DATA_LEN ] ,
761
+ attribution_data : Some ( [ 0 ; ATTRIBUTION_DATA_LEN ] ) ,
762
762
} ;
763
763
let failure = onion_utils:: encrypt_failure_packet (
764
764
& onion_keys[ 1 ] . shared_secret . as_ref ( ) , & onion_error) ;
0 commit comments