Skip to content

Commit 15a7189

Browse files
committed
f - missed fuzz tests
1 parent 73202a1 commit 15a7189

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

fuzz/src/invoice_request_deser.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use bitcoin::secp256k1::{KeyPair, Parity, PublicKey, Secp256k1, SecretKey, self}
1111
use crate::utils::test_logger;
1212
use core::convert::TryFrom;
1313
use lightning::blinded_path::BlindedPath;
14+
use lightning::blinded_path::message::ForwardNode;
1415
use lightning::sign::EntropySource;
1516
use lightning::ln::PaymentHash;
1617
use lightning::ln::features::BlindedHopFeatures;
@@ -73,9 +74,19 @@ fn build_response<T: secp256k1::Signing + secp256k1::Verification>(
7374
invoice_request: &InvoiceRequest, secp_ctx: &Secp256k1<T>
7475
) -> Result<UnsignedBolt12Invoice, Bolt12SemanticError> {
7576
let entropy_source = Randomness {};
77+
let intermediate_nodes = [
78+
[
79+
ForwardNode { node_id: pubkey(43), short_channel_id: None },
80+
ForwardNode { node_id: pubkey(44), short_channel_id: None },
81+
],
82+
[
83+
ForwardNode { node_id: pubkey(45), short_channel_id: None },
84+
ForwardNode { node_id: pubkey(46), short_channel_id: None },
85+
],
86+
];
7687
let paths = vec![
77-
BlindedPath::new_for_message(&[pubkey(43), pubkey(44), pubkey(42)], &entropy_source, secp_ctx).unwrap(),
78-
BlindedPath::new_for_message(&[pubkey(45), pubkey(46), pubkey(42)], &entropy_source, secp_ctx).unwrap(),
88+
BlindedPath::new_for_message(&intermediate_nodes[0], pubkey(42), &entropy_source, secp_ctx).unwrap(),
89+
BlindedPath::new_for_message(&intermediate_nodes[1], pubkey(42), &entropy_source, secp_ctx).unwrap(),
7990
];
8091

8192
let payinfo = vec![

fuzz/src/refund_deser.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use bitcoin::secp256k1::{KeyPair, PublicKey, Secp256k1, SecretKey, self};
1111
use crate::utils::test_logger;
1212
use core::convert::TryFrom;
1313
use lightning::blinded_path::BlindedPath;
14+
use lightning::blinded_path::message::ForwardNode;
1415
use lightning::sign::EntropySource;
1516
use lightning::ln::PaymentHash;
1617
use lightning::ln::features::BlindedHopFeatures;
@@ -62,9 +63,19 @@ fn build_response<T: secp256k1::Signing + secp256k1::Verification>(
6263
refund: &Refund, signing_pubkey: PublicKey, secp_ctx: &Secp256k1<T>
6364
) -> Result<UnsignedBolt12Invoice, Bolt12SemanticError> {
6465
let entropy_source = Randomness {};
66+
let intermediate_nodes = [
67+
[
68+
ForwardNode { node_id: pubkey(43), short_channel_id: None },
69+
ForwardNode { node_id: pubkey(44), short_channel_id: None },
70+
],
71+
[
72+
ForwardNode { node_id: pubkey(45), short_channel_id: None },
73+
ForwardNode { node_id: pubkey(46), short_channel_id: None },
74+
],
75+
];
6576
let paths = vec![
66-
BlindedPath::new_for_message(&[pubkey(43), pubkey(44), pubkey(42)], &entropy_source, secp_ctx).unwrap(),
67-
BlindedPath::new_for_message(&[pubkey(45), pubkey(46), pubkey(42)], &entropy_source, secp_ctx).unwrap(),
77+
BlindedPath::new_for_message(&intermediate_nodes[0], pubkey(42), &entropy_source, secp_ctx).unwrap(),
78+
BlindedPath::new_for_message(&intermediate_nodes[1], pubkey(42), &entropy_source, secp_ctx).unwrap(),
6879
];
6980

7081
let payinfo = vec![

0 commit comments

Comments
 (0)