Skip to content

Commit 21110c8

Browse files
authored
Merge pull request #4202 from carlaKC/3789-test-vectors
Zero fee commitment test vectors
2 parents bda19d6 + c9bd30a commit 21110c8

File tree

3 files changed

+745
-312
lines changed

3 files changed

+745
-312
lines changed

lightning/src/ln/blinded_payment_tests.rs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
// You may not use this file except in accordance with one or both of these
1010
// licenses.
1111

12-
use bitcoin::hashes::hex::FromHex;
1312
use bitcoin::hex::DisplayHex;
1413
use bitcoin::secp256k1::{PublicKey, Scalar, Secp256k1, SecretKey, schnorr};
1514
use bitcoin::secp256k1::ecdh::SharedSecret;
@@ -36,7 +35,7 @@ use crate::routing::router::{BlindedTail, Path, Payee, PaymentParameters, RouteH
3635
use crate::sign::{NodeSigner, PeerStorageKey, ReceiveAuthKey, Recipient};
3736
use crate::util::config::UserConfig;
3837
use crate::util::ser::{WithoutLength, Writeable};
39-
use crate::util::test_utils;
38+
use crate::util::test_utils::{self, bytes_from_hex, secret_from_hex, pubkey_from_hex};
4039
use lightning_invoice::RawBolt11Invoice;
4140
use types::features::Features;
4241
use crate::blinded_path::BlindedHop;
@@ -1489,18 +1488,6 @@ fn blinded_payment_path_padding() {
14891488
claim_payment(&nodes[0], &[&nodes[1], &nodes[2], &nodes[3], &nodes[4]], payment_preimage);
14901489
}
14911490

1492-
fn secret_from_hex(hex: &str) -> SecretKey {
1493-
SecretKey::from_slice(&<Vec<u8>>::from_hex(hex).unwrap()).unwrap()
1494-
}
1495-
1496-
fn bytes_from_hex(hex: &str) -> Vec<u8> {
1497-
<Vec<u8>>::from_hex(hex).unwrap()
1498-
}
1499-
1500-
fn pubkey_from_hex(hex: &str) -> PublicKey {
1501-
PublicKey::from_slice(&<Vec<u8>>::from_hex(hex).unwrap()).unwrap()
1502-
}
1503-
15041491
fn update_add_msg(
15051492
amount_msat: u64, cltv_expiry: u32, blinding_point: Option<PublicKey>,
15061493
onion_routing_packet: msgs::OnionPacket

0 commit comments

Comments
 (0)