Skip to content

Commit 2086194

Browse files
committed
f - add parses_invoice_request_without_signature test
1 parent faeb7e1 commit 2086194

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

lightning/src/offers/invoice_request.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,6 +1105,22 @@ mod tests {
11051105
}
11061106
}
11071107

1108+
#[test]
1109+
fn parses_invoice_request_without_signature() {
1110+
let mut buffer = Vec::new();
1111+
OfferBuilder::new("foo".into(), recipient_pubkey())
1112+
.amount_msats(1000)
1113+
.build().unwrap()
1114+
.request_invoice(vec![1; 32], payer_pubkey())
1115+
.build().unwrap()
1116+
.invoice_request
1117+
.write(&mut buffer).unwrap();
1118+
1119+
if let Err(e) = InvoiceRequest::try_from(buffer) {
1120+
panic!("error parsing invoice_request: {:?}", e);
1121+
}
1122+
}
1123+
11081124
#[test]
11091125
fn fails_parsing_invoice_request_with_invalid_signature() {
11101126
let mut invoice_request = OfferBuilder::new("foo".into(), recipient_pubkey())

0 commit comments

Comments
 (0)