Skip to content

Commit

Permalink
f - use verify_using_payer_data in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jkczyz committed Jul 19, 2024
1 parent 5d365d1 commit 667e4d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lightning/src/offers/invoice_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1511,7 +1511,7 @@ mod tests {
signature_tlv_stream.write(&mut encoded_invoice).unwrap();

let invoice = Bolt12Invoice::try_from(encoded_invoice).unwrap();
assert!(invoice.verify(&expanded_key, &secp_ctx).is_err());
assert!(!invoice.verify_using_payer_data(payment_id, nonce, &expanded_key, &secp_ctx));

// Fails verification with altered payer id
let (
Expand All @@ -1534,7 +1534,7 @@ mod tests {
signature_tlv_stream.write(&mut encoded_invoice).unwrap();

let invoice = Bolt12Invoice::try_from(encoded_invoice).unwrap();
assert!(invoice.verify(&expanded_key, &secp_ctx).is_err());
assert!(!invoice.verify_using_payer_data(payment_id, nonce, &expanded_key, &secp_ctx));
}

#[test]
Expand Down
4 changes: 2 additions & 2 deletions lightning/src/offers/refund.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1122,7 +1122,7 @@ mod tests {
.unwrap()
.build().unwrap()
.sign(recipient_sign).unwrap();
assert!(invoice.verify(&expanded_key, &secp_ctx).is_err());
assert!(!invoice.verify_using_payer_data(payment_id, nonce, &expanded_key, &secp_ctx));

// Fails verification with altered payer_id
let mut tlv_stream = refund.as_tlv_stream();
Expand All @@ -1137,7 +1137,7 @@ mod tests {
.unwrap()
.build().unwrap()
.sign(recipient_sign).unwrap();
assert!(invoice.verify(&expanded_key, &secp_ctx).is_err());
assert!(!invoice.verify_using_payer_data(payment_id, nonce, &expanded_key, &secp_ctx));
}

#[test]
Expand Down

0 comments on commit 667e4d2

Please sign in to comment.