Skip to content

Commit 847fe08

Browse files
committed
test new signatue data variant
1 parent 67e3312 commit 847fe08

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

lightning/src/offers/invoice_request.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1564,6 +1564,23 @@ mod tests {
15641564
assert_eq!(tlv_stream.payer_note, Some(&String::from("baz")));
15651565
}
15661566

1567+
#[test]
1568+
fn builds_invoice_request_with_raw_data() {
1569+
// We'll test that the raw_data builder option works as anticipated.
1570+
let unsigned_invoice_request = OfferBuilder::new("foo".into(), recipient_pubkey())
1571+
.amount_msats(1000)
1572+
.build().unwrap()
1573+
.request_invoice(vec![1; 32], payer_pubkey()).unwrap()
1574+
.raw_data()
1575+
.build().unwrap();
1576+
1577+
// Ensure that getting the raw data doesn't return an error.
1578+
let _ = unsigned_invoice_request.raw_data();
1579+
1580+
let invoice_request = unsigned_invoice_request
1581+
.sign(payer_sign).unwrap();
1582+
}
1583+
15671584
#[test]
15681585
fn fails_signing_invoice_request() {
15691586
match OfferBuilder::new("foo".into(), recipient_pubkey())

0 commit comments

Comments
 (0)