Skip to content

Commit ecd283e

Browse files
committed
Include signature check in BOLT 12 signature test
The BOLT 12 test vectors had inadvertently left out a signature, but it has since been added. Include a signature check in the corresponding test for completeness.
1 parent 8540985 commit ecd283e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lightning/src/offers/merkle.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ mod tests {
226226

227227
use bitcoin::hashes::{Hash, sha256};
228228
use bitcoin::secp256k1::{KeyPair, Secp256k1, SecretKey};
229+
use bitcoin::secp256k1::schnorr::Signature;
229230
use core::convert::Infallible;
230231
use crate::offers::offer::{Amount, OfferBuilder};
231232
use crate::offers::invoice_request::InvoiceRequest;
@@ -280,6 +281,10 @@ mod tests {
280281
super::root_hash(&invoice_request.bytes[..]),
281282
sha256::Hash::from_slice(&hex::decode("608407c18ad9a94d9ea2bcdbe170b6c20c462a7833a197621c916f78cf18e624").unwrap()).unwrap(),
282283
);
284+
assert_eq!(
285+
invoice_request.signature(),
286+
Signature::from_slice(&hex::decode("b8f83ea3288cfd6ea510cdb481472575141e8d8744157f98562d162cc1c472526fdb24befefbdebab4dbb726bbd1b7d8aec057f8fa805187e5950d2bbe0e5642").unwrap()).unwrap(),
287+
);
283288
}
284289

285290
#[test]

0 commit comments

Comments
 (0)