@@ -248,12 +248,12 @@ macro_rules! offer_derived_metadata_builder_methods { ($secp_context: ty) => {
248248 /// `node_id` is used for the signing pubkey.
249249 ///
250250 /// Also, sets the metadata when [`OfferBuilder::build`] is called such that it can be used by
251- /// [`InvoiceRequest::verify `] to determine if the request was produced for the offer given an
252- /// [`ExpandedKey`]. However, if [`OfferBuilder::path`] is called, then the metadata will not be
253- /// set and must be included in each [`BlindedPath`] instead. In this case, use
254- /// [`InvoiceRequest::verify_using_recipient_data`].
251+ /// [`InvoiceRequest::verify_using_metadata `] to determine if the request was produced for the
252+ /// offer given an [`ExpandedKey`]. However, if [`OfferBuilder::path`] is called, then the
253+ /// metadata will not be set and must be included in each [`BlindedPath`] instead. In this case,
254+ /// use [`InvoiceRequest::verify_using_recipient_data`].
255255 ///
256- /// [`InvoiceRequest::verify `]: crate::offers::invoice_request::InvoiceRequest::verify
256+ /// [`InvoiceRequest::verify_using_metadata `]: crate::offers::invoice_request::InvoiceRequest::verify_using_metadata
257257 /// [`InvoiceRequest::verify_using_recipient_data`]: crate::offers::invoice_request::InvoiceRequest::verify_using_recipient_data
258258 /// [`ExpandedKey`]: crate::ln::inbound_payment::ExpandedKey
259259 pub fn deriving_signing_pubkey(
@@ -922,20 +922,20 @@ impl OfferContents {
922922 self . signing_pubkey
923923 }
924924
925- pub ( super ) fn verify < T : secp256k1:: Signing > (
925+ pub ( super ) fn verify_using_metadata < T : secp256k1:: Signing > (
926926 & self , bytes : & [ u8 ] , key : & ExpandedKey , secp_ctx : & Secp256k1 < T >
927927 ) -> Result < ( OfferId , Option < Keypair > ) , ( ) > {
928- self . verify_using_metadata ( bytes, self . metadata . as_ref ( ) , key, secp_ctx)
928+ self . verify ( bytes, self . metadata . as_ref ( ) , key, secp_ctx)
929929 }
930930
931931 pub ( super ) fn verify_using_recipient_data < T : secp256k1:: Signing > (
932932 & self , bytes : & [ u8 ] , nonce : Nonce , key : & ExpandedKey , secp_ctx : & Secp256k1 < T >
933933 ) -> Result < ( OfferId , Option < Keypair > ) , ( ) > {
934- self . verify_using_metadata ( bytes, Some ( & Metadata :: RecipientData ( nonce) ) , key, secp_ctx)
934+ self . verify ( bytes, Some ( & Metadata :: RecipientData ( nonce) ) , key, secp_ctx)
935935 }
936936
937937 /// Verifies that the offer metadata was produced from the offer in the TLV stream.
938- fn verify_using_metadata < T : secp256k1:: Signing > (
938+ fn verify < T : secp256k1:: Signing > (
939939 & self , bytes : & [ u8 ] , metadata : Option < & Metadata > , key : & ExpandedKey , secp_ctx : & Secp256k1 < T >
940940 ) -> Result < ( OfferId , Option < Keypair > ) , ( ) > {
941941 match metadata {
@@ -1311,7 +1311,7 @@ mod tests {
13111311 let invoice_request = offer. request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) ) . unwrap ( )
13121312 . build ( ) . unwrap ( )
13131313 . sign ( payer_sign) . unwrap ( ) ;
1314- match invoice_request. verify ( & expanded_key, & secp_ctx) {
1314+ match invoice_request. verify_using_metadata ( & expanded_key, & secp_ctx) {
13151315 Ok ( invoice_request) => assert_eq ! ( invoice_request. offer_id, offer. id( ) ) ,
13161316 Err ( _) => panic ! ( "unexpected error" ) ,
13171317 }
@@ -1335,7 +1335,7 @@ mod tests {
13351335 . request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) ) . unwrap ( )
13361336 . build ( ) . unwrap ( )
13371337 . sign ( payer_sign) . unwrap ( ) ;
1338- assert ! ( invoice_request. verify ( & expanded_key, & secp_ctx) . is_err( ) ) ;
1338+ assert ! ( invoice_request. verify_using_metadata ( & expanded_key, & secp_ctx) . is_err( ) ) ;
13391339
13401340 // Fails verification with altered metadata
13411341 let mut tlv_stream = offer. as_tlv_stream ( ) ;
@@ -1349,7 +1349,7 @@ mod tests {
13491349 . request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) ) . unwrap ( )
13501350 . build ( ) . unwrap ( )
13511351 . sign ( payer_sign) . unwrap ( ) ;
1352- assert ! ( invoice_request. verify ( & expanded_key, & secp_ctx) . is_err( ) ) ;
1352+ assert ! ( invoice_request. verify_using_metadata ( & expanded_key, & secp_ctx) . is_err( ) ) ;
13531353 }
13541354
13551355 #[ test]
@@ -1390,7 +1390,7 @@ mod tests {
13901390 let invoice_request = offer. request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) ) . unwrap ( )
13911391 . build ( ) . unwrap ( )
13921392 . sign ( payer_sign) . unwrap ( ) ;
1393- assert ! ( invoice_request. verify ( & expanded_key, & secp_ctx) . is_err( ) ) ;
1393+ assert ! ( invoice_request. verify_using_metadata ( & expanded_key, & secp_ctx) . is_err( ) ) ;
13941394
13951395 // Fails verification with altered offer field
13961396 let mut tlv_stream = offer. as_tlv_stream ( ) ;
0 commit comments