Skip to content

Commit e52c347

Browse files
committed
f - add parses_invoice_request_without_signature test
1 parent 54eb6a0 commit e52c347

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
@@ -1182,6 +1182,22 @@ mod tests {
11821182
}
11831183
}
11841184

1185+
#[test]
1186+
fn parses_invoice_request_without_signature() {
1187+
let mut buffer = Vec::new();
1188+
OfferBuilder::new("foo".into(), recipient_pubkey())
1189+
.amount_msats(1000)
1190+
.build().unwrap()
1191+
.request_invoice(vec![1; 32], payer_pubkey())
1192+
.build().unwrap()
1193+
.invoice_request
1194+
.write(&mut buffer).unwrap();
1195+
1196+
if let Err(e) = InvoiceRequest::try_from(buffer) {
1197+
panic!("error parsing invoice_request: {:?}", e);
1198+
}
1199+
}
1200+
11851201
#[test]
11861202
fn fails_parsing_invoice_request_with_invalid_signature() {
11871203
let mut invoice_request = OfferBuilder::new("foo".into(), recipient_pubkey())

0 commit comments

Comments
 (0)