@@ -565,6 +565,7 @@ mod tests {
565565 use crate :: offers:: invoice:: InvoiceTlvStreamRef ;
566566 use crate :: offers:: merkle;
567567 use crate :: offers:: merkle:: { SignatureTlvStreamRef , TaggedHash } ;
568+ use crate :: offers:: nonce:: Nonce ;
568569 use crate :: offers:: offer:: { Offer , OfferBuilder , OfferTlvStreamRef , Quantity } ;
569570 use crate :: offers:: parse:: { Bolt12ParseError , Bolt12SemanticError } ;
570571 use crate :: offers:: static_invoice:: {
@@ -608,13 +609,13 @@ mod tests {
608609 let now = now ( ) ;
609610 let expanded_key = ExpandedKey :: new ( & KeyMaterial ( [ 42 ; 32 ] ) ) ;
610611 let entropy = FixedEntropy { } ;
612+ let nonce = Nonce :: from_entropy_source ( & entropy) ;
611613 let secp_ctx = Secp256k1 :: new ( ) ;
612614
613- let offer =
614- OfferBuilder :: deriving_signing_pubkey ( node_id, & expanded_key, & entropy, & secp_ctx)
615- . path ( blinded_path ( ) )
616- . build ( )
617- . unwrap ( ) ;
615+ let offer = OfferBuilder :: deriving_signing_pubkey ( node_id, & expanded_key, nonce, & secp_ctx)
616+ . path ( blinded_path ( ) )
617+ . build ( )
618+ . unwrap ( ) ;
618619
619620 StaticInvoiceBuilder :: for_offer_using_derived_keys (
620621 & offer,
@@ -647,13 +648,13 @@ mod tests {
647648 let now = now ( ) ;
648649 let expanded_key = ExpandedKey :: new ( & KeyMaterial ( [ 42 ; 32 ] ) ) ;
649650 let entropy = FixedEntropy { } ;
651+ let nonce = Nonce :: from_entropy_source ( & entropy) ;
650652 let secp_ctx = Secp256k1 :: new ( ) ;
651653
652- let offer =
653- OfferBuilder :: deriving_signing_pubkey ( node_id, & expanded_key, & entropy, & secp_ctx)
654- . path ( blinded_path ( ) )
655- . build ( )
656- . unwrap ( ) ;
654+ let offer = OfferBuilder :: deriving_signing_pubkey ( node_id, & expanded_key, nonce, & secp_ctx)
655+ . path ( blinded_path ( ) )
656+ . build ( )
657+ . unwrap ( ) ;
657658
658659 let invoice = StaticInvoiceBuilder :: for_offer_using_derived_keys (
659660 & offer,
@@ -742,13 +743,14 @@ mod tests {
742743 let now = now ( ) ;
743744 let expanded_key = ExpandedKey :: new ( & KeyMaterial ( [ 42 ; 32 ] ) ) ;
744745 let entropy = FixedEntropy { } ;
746+ let nonce = Nonce :: from_entropy_source ( & entropy) ;
745747 let secp_ctx = Secp256k1 :: new ( ) ;
746748
747749 let future_expiry = Duration :: from_secs ( u64:: max_value ( ) ) ;
748750 let past_expiry = Duration :: from_secs ( 0 ) ;
749751
750752 let valid_offer =
751- OfferBuilder :: deriving_signing_pubkey ( node_id, & expanded_key, & entropy , & secp_ctx)
753+ OfferBuilder :: deriving_signing_pubkey ( node_id, & expanded_key, nonce , & secp_ctx)
752754 . path ( blinded_path ( ) )
753755 . absolute_expiry ( future_expiry)
754756 . build ( )
@@ -769,7 +771,7 @@ mod tests {
769771 assert_eq ! ( invoice. absolute_expiry( ) , Some ( future_expiry) ) ;
770772
771773 let expired_offer =
772- OfferBuilder :: deriving_signing_pubkey ( node_id, & expanded_key, & entropy , & secp_ctx)
774+ OfferBuilder :: deriving_signing_pubkey ( node_id, & expanded_key, nonce , & secp_ctx)
773775 . path ( blinded_path ( ) )
774776 . absolute_expiry ( past_expiry)
775777 . build ( )
@@ -797,10 +799,11 @@ mod tests {
797799 let now = now ( ) ;
798800 let expanded_key = ExpandedKey :: new ( & KeyMaterial ( [ 42 ; 32 ] ) ) ;
799801 let entropy = FixedEntropy { } ;
802+ let nonce = Nonce :: from_entropy_source ( & entropy) ;
800803 let secp_ctx = Secp256k1 :: new ( ) ;
801804
802805 let valid_offer =
803- OfferBuilder :: deriving_signing_pubkey ( node_id, & expanded_key, & entropy , & secp_ctx)
806+ OfferBuilder :: deriving_signing_pubkey ( node_id, & expanded_key, nonce , & secp_ctx)
804807 . path ( blinded_path ( ) )
805808 . build ( )
806809 . unwrap ( ) ;
@@ -860,10 +863,11 @@ mod tests {
860863 let now = now ( ) ;
861864 let expanded_key = ExpandedKey :: new ( & KeyMaterial ( [ 42 ; 32 ] ) ) ;
862865 let entropy = FixedEntropy { } ;
866+ let nonce = Nonce :: from_entropy_source ( & entropy) ;
863867 let secp_ctx = Secp256k1 :: new ( ) ;
864868
865869 let valid_offer =
866- OfferBuilder :: deriving_signing_pubkey ( node_id, & expanded_key, & entropy , & secp_ctx)
870+ OfferBuilder :: deriving_signing_pubkey ( node_id, & expanded_key, nonce , & secp_ctx)
867871 . path ( blinded_path ( ) )
868872 . build ( )
869873 . unwrap ( ) ;
@@ -916,10 +920,11 @@ mod tests {
916920 let now = now ( ) ;
917921 let expanded_key = ExpandedKey :: new ( & KeyMaterial ( [ 42 ; 32 ] ) ) ;
918922 let entropy = FixedEntropy { } ;
923+ let nonce = Nonce :: from_entropy_source ( & entropy) ;
919924 let secp_ctx = Secp256k1 :: new ( ) ;
920925
921926 let offer_with_extra_chain =
922- OfferBuilder :: deriving_signing_pubkey ( node_id, & expanded_key, & entropy , & secp_ctx)
927+ OfferBuilder :: deriving_signing_pubkey ( node_id, & expanded_key, nonce , & secp_ctx)
923928 . path ( blinded_path ( ) )
924929 . chain ( Network :: Bitcoin )
925930 . chain ( Network :: Testnet )
@@ -947,13 +952,13 @@ mod tests {
947952 let now = now ( ) ;
948953 let expanded_key = ExpandedKey :: new ( & KeyMaterial ( [ 42 ; 32 ] ) ) ;
949954 let entropy = FixedEntropy { } ;
955+ let nonce = Nonce :: from_entropy_source ( & entropy) ;
950956 let secp_ctx = Secp256k1 :: new ( ) ;
951957
952- let offer =
953- OfferBuilder :: deriving_signing_pubkey ( node_id, & expanded_key, & entropy, & secp_ctx)
954- . path ( blinded_path ( ) )
955- . build ( )
956- . unwrap ( ) ;
958+ let offer = OfferBuilder :: deriving_signing_pubkey ( node_id, & expanded_key, nonce, & secp_ctx)
959+ . path ( blinded_path ( ) )
960+ . build ( )
961+ . unwrap ( ) ;
957962
958963 const TEST_RELATIVE_EXPIRY : u32 = 3600 ;
959964 let invoice = StaticInvoiceBuilder :: for_offer_using_derived_keys (
@@ -988,13 +993,13 @@ mod tests {
988993 let now = now ( ) ;
989994 let expanded_key = ExpandedKey :: new ( & KeyMaterial ( [ 42 ; 32 ] ) ) ;
990995 let entropy = FixedEntropy { } ;
996+ let nonce = Nonce :: from_entropy_source ( & entropy) ;
991997 let secp_ctx = Secp256k1 :: new ( ) ;
992998
993- let offer =
994- OfferBuilder :: deriving_signing_pubkey ( node_id, & expanded_key, & entropy, & secp_ctx)
995- . path ( blinded_path ( ) )
996- . build ( )
997- . unwrap ( ) ;
999+ let offer = OfferBuilder :: deriving_signing_pubkey ( node_id, & expanded_key, nonce, & secp_ctx)
1000+ . path ( blinded_path ( ) )
1001+ . build ( )
1002+ . unwrap ( ) ;
9981003
9991004 let invoice = StaticInvoiceBuilder :: for_offer_using_derived_keys (
10001005 & offer,
0 commit comments