@@ -567,6 +567,7 @@ mod tests {
567567 use crate :: offers:: invoice:: InvoiceTlvStreamRef ;
568568 use crate :: offers:: merkle;
569569 use crate :: offers:: merkle:: { SignatureTlvStreamRef , TaggedHash } ;
570+ use crate :: offers:: nonce:: Nonce ;
570571 use crate :: offers:: offer:: { Offer , OfferBuilder , OfferTlvStreamRef , Quantity } ;
571572 use crate :: offers:: parse:: { Bolt12ParseError , Bolt12SemanticError } ;
572573 use crate :: offers:: static_invoice:: {
@@ -610,13 +611,13 @@ mod tests {
610611 let now = now ( ) ;
611612 let expanded_key = ExpandedKey :: new ( & KeyMaterial ( [ 42 ; 32 ] ) ) ;
612613 let entropy = FixedEntropy { } ;
614+ let nonce = Nonce :: from_entropy_source ( & entropy) ;
613615 let secp_ctx = Secp256k1 :: new ( ) ;
614616
615- let offer =
616- OfferBuilder :: deriving_signing_pubkey ( node_id, & expanded_key, & entropy, & secp_ctx)
617- . path ( blinded_path ( ) )
618- . build ( )
619- . unwrap ( ) ;
617+ let offer = OfferBuilder :: deriving_signing_pubkey ( node_id, & expanded_key, nonce, & secp_ctx)
618+ . path ( blinded_path ( ) )
619+ . build ( )
620+ . unwrap ( ) ;
620621
621622 StaticInvoiceBuilder :: for_offer_using_derived_keys (
622623 & offer,
@@ -649,13 +650,13 @@ mod tests {
649650 let now = now ( ) ;
650651 let expanded_key = ExpandedKey :: new ( & KeyMaterial ( [ 42 ; 32 ] ) ) ;
651652 let entropy = FixedEntropy { } ;
653+ let nonce = Nonce :: from_entropy_source ( & entropy) ;
652654 let secp_ctx = Secp256k1 :: new ( ) ;
653655
654- let offer =
655- OfferBuilder :: deriving_signing_pubkey ( node_id, & expanded_key, & entropy, & secp_ctx)
656- . path ( blinded_path ( ) )
657- . build ( )
658- . unwrap ( ) ;
656+ let offer = OfferBuilder :: deriving_signing_pubkey ( node_id, & expanded_key, nonce, & secp_ctx)
657+ . path ( blinded_path ( ) )
658+ . build ( )
659+ . unwrap ( ) ;
659660
660661 let invoice = StaticInvoiceBuilder :: for_offer_using_derived_keys (
661662 & offer,
@@ -744,13 +745,14 @@ mod tests {
744745 let now = now ( ) ;
745746 let expanded_key = ExpandedKey :: new ( & KeyMaterial ( [ 42 ; 32 ] ) ) ;
746747 let entropy = FixedEntropy { } ;
748+ let nonce = Nonce :: from_entropy_source ( & entropy) ;
747749 let secp_ctx = Secp256k1 :: new ( ) ;
748750
749751 let future_expiry = Duration :: from_secs ( u64:: max_value ( ) ) ;
750752 let past_expiry = Duration :: from_secs ( 0 ) ;
751753
752754 let valid_offer =
753- OfferBuilder :: deriving_signing_pubkey ( node_id, & expanded_key, & entropy , & secp_ctx)
755+ OfferBuilder :: deriving_signing_pubkey ( node_id, & expanded_key, nonce , & secp_ctx)
754756 . path ( blinded_path ( ) )
755757 . absolute_expiry ( future_expiry)
756758 . build ( )
@@ -771,7 +773,7 @@ mod tests {
771773 assert_eq ! ( invoice. absolute_expiry( ) , Some ( future_expiry) ) ;
772774
773775 let expired_offer =
774- OfferBuilder :: deriving_signing_pubkey ( node_id, & expanded_key, & entropy , & secp_ctx)
776+ OfferBuilder :: deriving_signing_pubkey ( node_id, & expanded_key, nonce , & secp_ctx)
775777 . path ( blinded_path ( ) )
776778 . absolute_expiry ( past_expiry)
777779 . build ( )
@@ -799,10 +801,11 @@ mod tests {
799801 let now = now ( ) ;
800802 let expanded_key = ExpandedKey :: new ( & KeyMaterial ( [ 42 ; 32 ] ) ) ;
801803 let entropy = FixedEntropy { } ;
804+ let nonce = Nonce :: from_entropy_source ( & entropy) ;
802805 let secp_ctx = Secp256k1 :: new ( ) ;
803806
804807 let valid_offer =
805- OfferBuilder :: deriving_signing_pubkey ( node_id, & expanded_key, & entropy , & secp_ctx)
808+ OfferBuilder :: deriving_signing_pubkey ( node_id, & expanded_key, nonce , & secp_ctx)
806809 . path ( blinded_path ( ) )
807810 . build ( )
808811 . unwrap ( ) ;
@@ -862,10 +865,11 @@ mod tests {
862865 let now = now ( ) ;
863866 let expanded_key = ExpandedKey :: new ( & KeyMaterial ( [ 42 ; 32 ] ) ) ;
864867 let entropy = FixedEntropy { } ;
868+ let nonce = Nonce :: from_entropy_source ( & entropy) ;
865869 let secp_ctx = Secp256k1 :: new ( ) ;
866870
867871 let valid_offer =
868- OfferBuilder :: deriving_signing_pubkey ( node_id, & expanded_key, & entropy , & secp_ctx)
872+ OfferBuilder :: deriving_signing_pubkey ( node_id, & expanded_key, nonce , & secp_ctx)
869873 . path ( blinded_path ( ) )
870874 . build ( )
871875 . unwrap ( ) ;
@@ -918,10 +922,11 @@ mod tests {
918922 let now = now ( ) ;
919923 let expanded_key = ExpandedKey :: new ( & KeyMaterial ( [ 42 ; 32 ] ) ) ;
920924 let entropy = FixedEntropy { } ;
925+ let nonce = Nonce :: from_entropy_source ( & entropy) ;
921926 let secp_ctx = Secp256k1 :: new ( ) ;
922927
923928 let offer_with_extra_chain =
924- OfferBuilder :: deriving_signing_pubkey ( node_id, & expanded_key, & entropy , & secp_ctx)
929+ OfferBuilder :: deriving_signing_pubkey ( node_id, & expanded_key, nonce , & secp_ctx)
925930 . path ( blinded_path ( ) )
926931 . chain ( Network :: Bitcoin )
927932 . chain ( Network :: Testnet )
@@ -949,13 +954,13 @@ mod tests {
949954 let now = now ( ) ;
950955 let expanded_key = ExpandedKey :: new ( & KeyMaterial ( [ 42 ; 32 ] ) ) ;
951956 let entropy = FixedEntropy { } ;
957+ let nonce = Nonce :: from_entropy_source ( & entropy) ;
952958 let secp_ctx = Secp256k1 :: new ( ) ;
953959
954- let offer =
955- OfferBuilder :: deriving_signing_pubkey ( node_id, & expanded_key, & entropy, & secp_ctx)
956- . path ( blinded_path ( ) )
957- . build ( )
958- . unwrap ( ) ;
960+ let offer = OfferBuilder :: deriving_signing_pubkey ( node_id, & expanded_key, nonce, & secp_ctx)
961+ . path ( blinded_path ( ) )
962+ . build ( )
963+ . unwrap ( ) ;
959964
960965 const TEST_RELATIVE_EXPIRY : u32 = 3600 ;
961966 let invoice = StaticInvoiceBuilder :: for_offer_using_derived_keys (
@@ -990,13 +995,13 @@ mod tests {
990995 let now = now ( ) ;
991996 let expanded_key = ExpandedKey :: new ( & KeyMaterial ( [ 42 ; 32 ] ) ) ;
992997 let entropy = FixedEntropy { } ;
998+ let nonce = Nonce :: from_entropy_source ( & entropy) ;
993999 let secp_ctx = Secp256k1 :: new ( ) ;
9941000
995- let offer =
996- OfferBuilder :: deriving_signing_pubkey ( node_id, & expanded_key, & entropy, & secp_ctx)
997- . path ( blinded_path ( ) )
998- . build ( )
999- . unwrap ( ) ;
1001+ let offer = OfferBuilder :: deriving_signing_pubkey ( node_id, & expanded_key, nonce, & secp_ctx)
1002+ . path ( blinded_path ( ) )
1003+ . build ( )
1004+ . unwrap ( ) ;
10001005
10011006 let invoice = StaticInvoiceBuilder :: for_offer_using_derived_keys (
10021007 & offer,
0 commit comments