@@ -418,7 +418,7 @@ fn test_onion_failure() {
418418 let onion_keys = onion_utils:: construct_onion_keys ( & Secp256k1 :: new ( ) , & route. paths [ 0 ] , & session_priv) . unwrap ( ) ;
419419 let failure = onion_utils:: build_first_hop_failure_packet ( onion_keys[ 0 ] . shared_secret . as_ref ( ) , NODE |2 , & [ 0 ; 0 ] ) ;
420420 msg. reason = failure. data ;
421- msg. attribution_data = Some ( failure. attribution_data ) ;
421+ msg. attribution_data = failure. attribution_data ;
422422 } , ||{ } , 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 ( ) ) ) ;
423423
424424 // final node failure
@@ -428,7 +428,7 @@ fn test_onion_failure() {
428428 let onion_keys = onion_utils:: construct_onion_keys ( & Secp256k1 :: new ( ) , & route. paths [ 0 ] , & session_priv) . unwrap ( ) ;
429429 let failure = onion_utils:: build_first_hop_failure_packet ( onion_keys[ 1 ] . shared_secret . as_ref ( ) , NODE |2 , & [ 0 ; 0 ] ) ;
430430 msg. reason = failure. data ;
431- msg. attribution_data = Some ( failure. attribution_data ) ;
431+ msg. attribution_data = failure. attribution_data ;
432432 } , ||{
433433 nodes[ 2 ] . node . fail_htlc_backwards ( & payment_hash) ;
434434 } , 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() {
442442 let onion_keys = onion_utils:: construct_onion_keys ( & Secp256k1 :: new ( ) , & route. paths [ 0 ] , & session_priv) . unwrap ( ) ;
443443 let failure = onion_utils:: build_first_hop_failure_packet ( onion_keys[ 0 ] . shared_secret . as_ref ( ) , PERM |NODE |2 , & [ 0 ; 0 ] ) ;
444444 msg. reason = failure. data ;
445- msg. attribution_data = Some ( failure. attribution_data ) ;
445+ msg. attribution_data = failure. attribution_data ;
446446 } , ||{ } , 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 ( ) ) ) ;
447447
448448 // final node failure
@@ -451,7 +451,7 @@ fn test_onion_failure() {
451451 let onion_keys = onion_utils:: construct_onion_keys ( & Secp256k1 :: new ( ) , & route. paths [ 0 ] , & session_priv) . unwrap ( ) ;
452452 let failure = onion_utils:: build_first_hop_failure_packet ( onion_keys[ 1 ] . shared_secret . as_ref ( ) , PERM |NODE |2 , & [ 0 ; 0 ] ) ;
453453 msg. reason = failure. data ;
454- msg. attribution_data = Some ( failure. attribution_data ) ;
454+ msg. attribution_data = failure. attribution_data ;
455455 } , ||{
456456 nodes[ 2 ] . node . fail_htlc_backwards ( & payment_hash) ;
457457 } , 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() {
465465 let onion_keys = onion_utils:: construct_onion_keys ( & Secp256k1 :: new ( ) , & route. paths [ 0 ] , & session_priv) . unwrap ( ) ;
466466 let failure = onion_utils:: build_first_hop_failure_packet ( onion_keys[ 0 ] . shared_secret . as_ref ( ) , PERM |NODE |3 , & [ 0 ; 0 ] ) ;
467467 msg. reason = failure. data ;
468- msg. attribution_data = Some ( failure. attribution_data ) ;
468+ msg. attribution_data = failure. attribution_data ;
469469 } , ||{
470470 nodes[ 2 ] . node . fail_htlc_backwards ( & payment_hash) ;
471471 } , 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() {
476476 let onion_keys = onion_utils:: construct_onion_keys ( & Secp256k1 :: new ( ) , & route. paths [ 0 ] , & session_priv) . unwrap ( ) ;
477477 let failure = onion_utils:: build_first_hop_failure_packet ( onion_keys[ 1 ] . shared_secret . as_ref ( ) , PERM |NODE |3 , & [ 0 ; 0 ] ) ;
478478 msg. reason = failure. data ;
479- msg. attribution_data = Some ( failure. attribution_data ) ;
479+ msg. attribution_data = failure. attribution_data ;
480480 } , ||{
481481 nodes[ 2 ] . node . fail_htlc_backwards ( & payment_hash) ;
482482 } , 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() {
508508 let onion_keys = onion_utils:: construct_onion_keys ( & Secp256k1 :: new ( ) , & route. paths [ 0 ] , & session_priv) . unwrap ( ) ;
509509 let failure = onion_utils:: build_first_hop_failure_packet ( onion_keys[ 0 ] . shared_secret . as_ref ( ) , UPDATE |7 , & err_data) ;
510510 msg. reason = failure. data ;
511- msg. attribution_data = Some ( failure. attribution_data ) ;
511+ msg. attribution_data = failure. attribution_data ;
512512 } , ||{ } , true , Some ( UPDATE |7 ) ,
513513 Some ( NetworkUpdate :: ChannelFailure { short_channel_id, is_permanent : false } ) ,
514514 Some ( short_channel_id) , Some ( next_hop_failure. clone ( ) ) ) ;
@@ -522,7 +522,7 @@ fn test_onion_failure() {
522522 let onion_keys = onion_utils:: construct_onion_keys ( & Secp256k1 :: new ( ) , & route. paths [ 0 ] , & session_priv) . unwrap ( ) ;
523523 let failure = onion_utils:: build_first_hop_failure_packet ( onion_keys[ 0 ] . shared_secret . as_ref ( ) , UPDATE |7 , & err_data_without_type) ;
524524 msg. reason = failure. data ;
525- msg. attribution_data = Some ( failure. attribution_data ) ;
525+ msg. attribution_data = failure. attribution_data ;
526526 } , ||{ } , true , Some ( UPDATE |7 ) ,
527527 Some ( NetworkUpdate :: ChannelFailure { short_channel_id, is_permanent : false } ) ,
528528 Some ( short_channel_id) , Some ( next_hop_failure. clone ( ) ) ) ;
@@ -535,7 +535,7 @@ fn test_onion_failure() {
535535 let onion_keys = onion_utils:: construct_onion_keys ( & Secp256k1 :: new ( ) , & route. paths [ 0 ] , & session_priv) . unwrap ( ) ;
536536 let failure = onion_utils:: build_first_hop_failure_packet ( onion_keys[ 0 ] . shared_secret . as_ref ( ) , PERM |8 , & [ 0 ; 0 ] ) ;
537537 msg. reason = failure. data ;
538- msg. attribution_data = Some ( failure. attribution_data ) ;
538+ msg. attribution_data = failure. attribution_data ;
539539 // short_channel_id from the processing node
540540 } , ||{ } , true , Some ( PERM |8 ) , Some ( NetworkUpdate :: ChannelFailure { short_channel_id, is_permanent : true } ) , Some ( short_channel_id) , Some ( next_hop_failure. clone ( ) ) ) ;
541541
@@ -547,7 +547,7 @@ fn test_onion_failure() {
547547 let onion_keys = onion_utils:: construct_onion_keys ( & Secp256k1 :: new ( ) , & route. paths [ 0 ] , & session_priv) . unwrap ( ) ;
548548 let failure = onion_utils:: build_first_hop_failure_packet ( onion_keys[ 0 ] . shared_secret . as_ref ( ) , PERM |9 , & [ 0 ; 0 ] ) ;
549549 msg. reason = failure. data ;
550- msg. attribution_data = Some ( failure. attribution_data ) ;
550+ msg. attribution_data = failure. attribution_data ;
551551 // short_channel_id from the processing node
552552 } , ||{ } , true , Some ( PERM |9 ) , Some ( NetworkUpdate :: ChannelFailure { short_channel_id, is_permanent : true } ) , Some ( short_channel_id) , Some ( next_hop_failure. clone ( ) ) ) ;
553553
@@ -681,7 +681,7 @@ fn test_onion_failure() {
681681 let onion_keys = onion_utils:: construct_onion_keys ( & Secp256k1 :: new ( ) , & route. paths [ 0 ] , & session_priv) . unwrap ( ) ;
682682 let failure = onion_utils:: build_first_hop_failure_packet ( onion_keys[ 1 ] . shared_secret . as_ref ( ) , 23 , & [ 0 ; 0 ] ) ;
683683 msg. reason = failure. data ;
684- msg. attribution_data = Some ( failure. attribution_data ) ;
684+ msg. attribution_data = failure. attribution_data ;
685685 } , ||{
686686 nodes[ 2 ] . node . fail_htlc_backwards ( & payment_hash) ;
687687 } , true , Some ( 23 ) , None , None , None ) ;
@@ -701,12 +701,12 @@ fn test_onion_failure() {
701701 decoded_err_packet. hmac = Hmac :: from_engine ( hmac) . to_byte_array ( ) ;
702702 let onion_error = OnionErrorPacket {
703703 data : decoded_err_packet. encode ( ) ,
704- attribution_data : [ 0 ; ATTRIBUTION_DATA_LEN ] ,
704+ attribution_data : Some ( [ 0 ; ATTRIBUTION_DATA_LEN ] ) ,
705705 } ;
706706 let failure = onion_utils:: encrypt_failure_packet (
707707 & onion_keys[ 1 ] . shared_secret . as_ref ( ) , & onion_error) ;
708708 msg. reason = failure. data ;
709- msg. attribution_data = Some ( failure. attribution_data ) ;
709+ msg. attribution_data = failure. attribution_data ;
710710 } , || nodes[ 2 ] . node . fail_htlc_backwards ( & payment_hash) , false , None ,
711711 Some ( NetworkUpdate :: NodeFailure { node_id : route. paths [ 0 ] . hops [ 1 ] . pubkey , is_permanent : true } ) ,
712712 Some ( channels[ 1 ] . 0 . contents . short_channel_id ) , None ) ;
@@ -730,7 +730,7 @@ fn test_onion_failure() {
730730 decoded_err_packet. hmac = Hmac :: from_engine ( hmac) . to_byte_array ( ) ;
731731 let onion_error = OnionErrorPacket {
732732 data : decoded_err_packet. encode ( ) ,
733- attribution_data : [ 0 ; ATTRIBUTION_DATA_LEN ] ,
733+ attribution_data : Some ( [ 0 ; ATTRIBUTION_DATA_LEN ] ) ,
734734 } ;
735735 let failure = onion_utils:: encrypt_failure_packet (
736736 & onion_keys[ 0 ] . shared_secret . as_ref ( ) , & onion_error) ;
@@ -758,7 +758,7 @@ fn test_onion_failure() {
758758 decoded_err_packet. hmac = Hmac :: from_engine ( hmac) . to_byte_array ( ) ;
759759 let onion_error = OnionErrorPacket {
760760 data : decoded_err_packet. encode ( ) ,
761- attribution_data : [ 0 ; ATTRIBUTION_DATA_LEN ] ,
761+ attribution_data : Some ( [ 0 ; ATTRIBUTION_DATA_LEN ] ) ,
762762 } ;
763763 let failure = onion_utils:: encrypt_failure_packet (
764764 & onion_keys[ 1 ] . shared_secret . as_ref ( ) , & onion_error) ;
0 commit comments