Skip to content

Commit ee67ccd

Browse files
committed
f - add parses_invoice_request_without_signature test
1 parent 2c12559 commit ee67ccd

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
@@ -1098,6 +1098,22 @@ mod tests {
10981098
}
10991099
}
11001100

1101+
#[test]
1102+
fn parses_invoice_request_without_signature() {
1103+
let mut buffer = Vec::new();
1104+
OfferBuilder::new("foo".into(), recipient_pubkey())
1105+
.amount_msats(1000)
1106+
.build().unwrap()
1107+
.request_invoice(vec![1; 32], payer_pubkey())
1108+
.build().unwrap()
1109+
.invoice_request
1110+
.write(&mut buffer).unwrap();
1111+
1112+
if let Err(e) = InvoiceRequest::try_from(buffer) {
1113+
panic!("error parsing invoice_request: {:?}", e);
1114+
}
1115+
}
1116+
11011117
#[test]
11021118
fn fails_parsing_invoice_request_with_invalid_signature() {
11031119
let mut invoice_request = OfferBuilder::new("foo".into(), recipient_pubkey())

0 commit comments

Comments
 (0)