@@ -420,7 +420,7 @@ pub trait Verification {
420420 ) -> Hmac<Sha256>;
421421
422422 /// Authenticates the data using an HMAC and a [`Nonce`] taken from an [`OffersContext`].
423- fn verify (
423+ fn verify_for_offer_payment (
424424 &self, hmac: Hmac<Sha256>, nonce: Nonce, expanded_key: &inbound_payment::ExpandedKey,
425425 ) -> Result<(), ()>;
426426}
@@ -436,7 +436,7 @@ impl Verification for PaymentHash {
436436
437437 /// Authenticates the payment id using an HMAC and a [`Nonce`] taken from an
438438 /// [`OffersContext::InboundPayment`].
439- fn verify (
439+ fn verify_for_offer_payment (
440440 &self, hmac: Hmac<Sha256>, nonce: Nonce, expanded_key: &inbound_payment::ExpandedKey,
441441 ) -> Result<(), ()> {
442442 signer::verify_payment_hash(*self, hmac, nonce, expanded_key)
@@ -461,15 +461,15 @@ impl Verification for PaymentId {
461461 fn hmac_for_offer_payment(
462462 &self, nonce: Nonce, expanded_key: &inbound_payment::ExpandedKey,
463463 ) -> Hmac<Sha256> {
464- signer::hmac_for_payment_id (*self, nonce, expanded_key)
464+ signer::hmac_for_offer_payment_id (*self, nonce, expanded_key)
465465 }
466466
467467 /// Authenticates the payment id using an HMAC and a [`Nonce`] taken from an
468468 /// [`OffersContext::OutboundPayment`].
469- fn verify (
469+ fn verify_for_offer_payment (
470470 &self, hmac: Hmac<Sha256>, nonce: Nonce, expanded_key: &inbound_payment::ExpandedKey,
471471 ) -> Result<(), ()> {
472- signer::verify_payment_id (*self, hmac, nonce, expanded_key)
472+ signer::verify_offer_payment_id (*self, hmac, nonce, expanded_key)
473473 }
474474}
475475
@@ -11144,7 +11144,7 @@ where
1114411144 OffersMessage::StaticInvoice(invoice) => {
1114511145 let payment_id = match context {
1114611146 Some(OffersContext::OutboundPayment { payment_id, nonce, hmac: Some(hmac) }) => {
11147- if payment_id.verify (hmac, nonce, expanded_key).is_err() {
11147+ if payment_id.verify_for_offer_payment (hmac, nonce, expanded_key).is_err() {
1114811148 return None
1114911149 }
1115011150 payment_id
@@ -11157,7 +11157,7 @@ where
1115711157 OffersMessage::InvoiceError(invoice_error) => {
1115811158 let payment_hash = match context {
1115911159 Some(OffersContext::InboundPayment { payment_hash, nonce, hmac }) => {
11160- match payment_hash.verify (hmac, nonce, expanded_key) {
11160+ match payment_hash.verify_for_offer_payment (hmac, nonce, expanded_key) {
1116111161 Ok(_) => Some(payment_hash),
1116211162 Err(_) => None,
1116311163 }
@@ -11170,7 +11170,7 @@ where
1117011170
1117111171 match context {
1117211172 Some(OffersContext::OutboundPayment { payment_id, nonce, hmac: Some(hmac) }) => {
11173- if let Ok(()) = payment_id.verify (hmac, nonce, expanded_key) {
11173+ if let Ok(()) = payment_id.verify_for_offer_payment (hmac, nonce, expanded_key) {
1117411174 self.abandon_payment_with_reason(
1117511175 payment_id, PaymentFailureReason::InvoiceRequestRejected,
1117611176 );
0 commit comments