use crate::routing::scoring::{ChannelUsage, FixedPenaltyScorer, ScoreLookUp, ProbabilisticScorer, ProbabilisticScoringFeeParameters, ProbabilisticScoringDecayParameters};
use crate::routing::test_utils::{add_channel, add_or_update_node, build_graph, build_line_graph, id_to_feature_flags, get_nodes, update_channel};
use crate::chain::transaction::OutPoint;
- use crate::sign::EntropySource;
use crate::ln::channel_state::{ChannelCounterparty, ChannelDetails, ChannelShutdownState};
use crate::ln::types::ChannelId;
use crate::ln::features::{BlindedHopFeatures, ChannelFeatures, InitFeatures, NodeFeatures};
let (_, our_id, _, nodes) = get_nodes(&secp_ctx);
let mut payment_params = PaymentParameters::from_node_id(nodes[2], 42);
let scorer = ln_test_utils::TestScorer::new();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
// Simple route to 2 via 1
let (_, our_id, _, nodes) = get_nodes(&secp_ctx);
let payment_params = PaymentParameters::from_node_id(nodes[2], 42);
let scorer = ln_test_utils::TestScorer::new();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
// Simple route to 2 via 1
let (our_privkey, our_id, privkeys, nodes) = get_nodes(&secp_ctx);
let payment_params = PaymentParameters::from_node_id(nodes[2], 42);
let scorer = ln_test_utils::TestScorer::new();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
// Simple route to 2 via 1
.with_bolt11_features(channelmanager::provided_bolt11_invoice_features(&config))
.unwrap();
let scorer = ln_test_utils::TestScorer::new();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
// A route to node#2 via two paths.
// One path allows transferring 35-40 sats, another one also allows 35-40 sats.
let config = UserConfig::default();
let payment_params = PaymentParameters::from_node_id(nodes[2], 42).with_bolt11_features(channelmanager::provided_bolt11_invoice_features(&config)).unwrap();
let scorer = ln_test_utils::TestScorer::new();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
// Route to node2 over a single path which requires overpaying the recipient themselves.
let (our_privkey, our_id, privkeys, nodes) = get_nodes(&secp_ctx);
let payment_params = PaymentParameters::from_node_id(nodes[2], 42);
let scorer = ln_test_utils::TestScorer::new();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
// // Disable channels 4 and 12 by flags=2
update_channel(&gossip_sync, &secp_ctx, &privkeys[1], UnsignedChannelUpdate {
let (_, our_id, privkeys, nodes) = get_nodes(&secp_ctx);
let payment_params = PaymentParameters::from_node_id(nodes[2], 42);
let scorer = ln_test_utils::TestScorer::new();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
// Disable nodes 1, 2, and 8 by requiring unknown feature bits
let mut unknown_features = NodeFeatures::empty();
let (secp_ctx, network_graph, _, _, logger) = build_graph();
let (_, our_id, _, nodes) = get_nodes(&secp_ctx);
let scorer = ln_test_utils::TestScorer::new();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
// Route to 1 via 2 and 3 because our channel to 1 is disabled
let payment_params = PaymentParameters::from_node_id(nodes[0], 42);
let (secp_ctx, network_graph, _, _, logger) = build_graph();
let (_, our_id, _, nodes) = get_nodes(&secp_ctx);
let scorer = ln_test_utils::TestScorer::new();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
// Simple test across 2, 3, 5, and 4 via a last_hop channel
// Tests the behaviour when the RouteHint contains a suboptimal hop.
let (_, our_id, _, nodes) = get_nodes(&secp_ctx);
let payment_params = PaymentParameters::from_node_id(nodes[6], 42).with_route_hints(empty_last_hop(&nodes)).unwrap();
let scorer = ln_test_utils::TestScorer::new();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
// Test handling of an empty RouteHint passed in Invoice.
let route_params = RouteParameters::from_payment_params_and_value(payment_params, 100);
let last_hops = multi_hop_last_hops_hint([nodes[2], nodes[3]]);
let payment_params = PaymentParameters::from_node_id(nodes[6], 42).with_route_hints(last_hops.clone()).unwrap();
let scorer = ln_test_utils::TestScorer::new();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
+
// Test through channels 2, 3, 0xff00, 0xff01.
// Test shows that multi-hop route hints are considered and factored correctly into the
// max path length.
let (_, our_id, _, nodes) = get_nodes(&secp_ctx);
let payment_params = PaymentParameters::from_node_id(nodes[6], 42).with_route_hints(last_hops_with_public_channel(&nodes)).unwrap();
let scorer = ln_test_utils::TestScorer::new();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
+
// This test shows that public routes can be present in the invoice
// which would be handled in the same manner.
let (secp_ctx, network_graph, _, _, logger) = build_graph();
let (_, our_id, _, nodes) = get_nodes(&secp_ctx);
let scorer = ln_test_utils::TestScorer::new();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
// Simple test with outbound channel to 4 to test that last_hops and first_hops connect
let our_chans = vec![get_channel_details(Some(42), nodes[3].clone(), InitFeatures::from_le_bytes(vec![0b11]), 250_000_000)];
let payment_params = PaymentParameters::from_node_id(target_node_id, 42).with_route_hints(vec![last_hops]).unwrap();
let our_chans = vec![get_channel_details(Some(42), middle_node_id, InitFeatures::from_le_bytes(vec![0b11]), outbound_capacity_msat)];
let scorer = ln_test_utils::TestScorer::new();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
let logger = ln_test_utils::TestLogger::new();
let network_graph = NetworkGraph::new(Network::Testnet, &logger);
let route_params = RouteParameters::from_payment_params_and_value(payment_params, route_val);
let (secp_ctx, network_graph, gossip_sync, chain_monitor, logger) = build_graph();
let (our_privkey, our_id, privkeys, nodes) = get_nodes(&secp_ctx);
let scorer = ln_test_utils::TestScorer::new();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
let config = UserConfig::default();
let payment_params = PaymentParameters::from_node_id(nodes[2], 42)
.with_bolt11_features(channelmanager::provided_bolt11_invoice_features(&config))
let (secp_ctx, network_graph, gossip_sync, _, logger) = build_graph();
let (our_privkey, our_id, privkeys, nodes) = get_nodes(&secp_ctx);
let scorer = ln_test_utils::TestScorer::new();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
let config = UserConfig::default();
let payment_params = PaymentParameters::from_node_id(nodes[3], 42)
.with_bolt11_features(channelmanager::provided_bolt11_invoice_features(&config))
let (secp_ctx, network_graph, gossip_sync, _, logger) = build_graph();
let (our_privkey, our_id, privkeys, nodes) = get_nodes(&secp_ctx);
let scorer = ln_test_utils::TestScorer::new();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
let payment_params = PaymentParameters::from_node_id(nodes[2], 42);
// Path via node0 is channels {1, 3}. Limit them to 100 and 50 sats (total limit 50).
let (secp_ctx, network_graph, gossip_sync, _, logger) = build_graph();
let (our_privkey, our_id, privkeys, nodes) = get_nodes(&secp_ctx);
let scorer = ln_test_utils::TestScorer::new();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
// We need a route consisting of 3 paths:
// From our node to node2 via node0, node7, node1 (three paths one hop each).
let (secp_ctx, network_graph, gossip_sync, _, logger) = build_graph();
let (our_privkey, our_id, privkeys, nodes) = get_nodes(&secp_ctx);
let scorer = ln_test_utils::TestScorer::new();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
let config = UserConfig::default();
let payment_params = PaymentParameters::from_node_id(nodes[3], 42)
.with_bolt11_features(channelmanager::provided_bolt11_invoice_features(&config))
let (secp_ctx, network_graph, gossip_sync, _, logger) = build_graph();
let (our_privkey, our_id, privkeys, nodes) = get_nodes(&secp_ctx);
let scorer = ln_test_utils::TestScorer::new();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
let config = UserConfig::default();
let payment_params = PaymentParameters::from_node_id(nodes[3], 42)
.with_bolt11_features(channelmanager::provided_bolt11_invoice_features(&config))
let (secp_ctx, network_graph, gossip_sync, _, logger) = build_graph();
let (our_privkey, our_id, privkeys, nodes) = get_nodes(&secp_ctx);
let scorer = ln_test_utils::TestScorer::new();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
let config = UserConfig::default();
let payment_params = PaymentParameters::from_node_id(nodes[3], 42)
.with_bolt11_features(channelmanager::provided_bolt11_invoice_features(&config))
let (secp_ctx, network_graph, gossip_sync, _, logger) = build_graph();
let (our_privkey, our_id, privkeys, nodes) = get_nodes(&secp_ctx);
let scorer = ln_test_utils::TestScorer::new();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
let config = UserConfig::default();
let payment_params = PaymentParameters::from_node_id(PublicKey::from_slice(&[02; 33]).unwrap(), 42)
.with_bolt11_features(channelmanager::provided_bolt11_invoice_features(&config)).unwrap()
let (secp_ctx, network_graph, gossip_sync, _, logger) = build_graph();
let (our_privkey, our_id, privkeys, nodes) = get_nodes(&secp_ctx);
let scorer = ln_test_utils::TestScorer::new();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
let config = UserConfig::default();
let payment_params = PaymentParameters::from_node_id(nodes[2], 42)
.with_bolt11_features(channelmanager::provided_bolt11_invoice_features(&config))
let gossip_sync = P2PGossipSync::new(Arc::clone(&network), None, Arc::clone(&logger));
let (our_privkey, our_id, privkeys, nodes) = get_nodes(&secp_ctx);
let scorer = ln_test_utils::TestScorer::new();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
let payment_params = PaymentParameters::from_node_id(nodes[6], 42);
add_channel(&gossip_sync, &secp_ctx, &our_privkey, &privkeys[1], ChannelFeatures::from_le_bytes(id_to_feature_flags(6)), 6);
let (secp_ctx, network_graph, gossip_sync, _, logger) = build_graph();
let (our_privkey, our_id, _, nodes) = get_nodes(&secp_ctx);
let scorer = ln_test_utils::TestScorer::new();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
let payment_params = PaymentParameters::from_node_id(nodes[2], 42);
// We modify the graph to set the htlc_maximum of channel 2 to below the value we wish to
let (secp_ctx, network_graph, gossip_sync, _, logger) = build_graph();
let (our_privkey, our_id, privkeys, nodes) = get_nodes(&secp_ctx);
let scorer = ln_test_utils::TestScorer::new();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
let config = UserConfig::default();
let payment_params = PaymentParameters::from_node_id(nodes[2], 42)
.with_bolt11_features(channelmanager::provided_bolt11_invoice_features(&config))
let payment_params = PaymentParameters::from_node_id(nodes[0], 42)
.with_bolt11_features(channelmanager::provided_bolt11_invoice_features(&config))
.unwrap();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
{
let route_params = RouteParameters::from_payment_params_and_value(
// Without penalizing each hop 100 msats, a longer path with lower fees is chosen.
let scorer = ln_test_utils::TestScorer::new();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
let route_params = RouteParameters::from_payment_params_and_value(
payment_params.clone(), 100);
let route = get_route( &our_id, &route_params, &network_graph.read_only(), None,
// A path to nodes[6] exists when no penalties are applied to any channel.
let scorer = ln_test_utils::TestScorer::new();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
let route_params = RouteParameters::from_payment_params_and_value(
payment_params, 100);
let route = get_route( &our_id, &route_params, &network_graph, None, Arc::clone(&logger),
let feasible_max_total_cltv_delta = 1008;
let feasible_payment_params = PaymentParameters::from_node_id(nodes[6], 0).with_route_hints(last_hops(&nodes)).unwrap()
.with_max_total_cltv_expiry_delta(feasible_max_total_cltv_delta);
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
let route_params = RouteParameters::from_payment_params_and_value(
feasible_payment_params, 100);
let route = get_route(&our_id, &route_params, &network_graph, None, Arc::clone(&logger),
let scorer = ln_test_utils::TestScorer::new();
let mut payment_params = PaymentParameters::from_node_id(nodes[6], 0).with_route_hints(last_hops(&nodes)).unwrap()
.with_max_path_count(1);
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
// We should be able to find a route initially, and then after we fail a few random
// channels eventually we won't be able to any longer.
let network_graph = network.read_only();
let scorer = ln_test_utils::TestScorer::new();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
// First check we can actually create a long route on this graph.
let feasible_payment_params = PaymentParameters::from_node_id(nodes[18], 0);
let scorer = ln_test_utils::TestScorer::new();
let payment_params = PaymentParameters::from_node_id(nodes[6], 42).with_route_hints(last_hops(&nodes)).unwrap();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
let route_params = RouteParameters::from_payment_params_and_value(
payment_params.clone(), 100);
let route = get_route(&our_id, &route_params, &network_graph.read_only(), None,
let network_channels = network_graph.channels();
let scorer = ln_test_utils::TestScorer::new();
let payment_params = PaymentParameters::from_node_id(nodes[3], 0);
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[4u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
let route_params = RouteParameters::from_payment_params_and_value(
payment_params.clone(), 100);
let (_, our_id, _, nodes) = get_nodes(&secp_ctx);
let network_graph = network.read_only();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
-
+ let random_seed_bytes = [42; 32];
let payment_params = PaymentParameters::from_node_id(nodes[3], 0);
let hops = [nodes[1], nodes[2], nodes[4], nodes[3]];
let route_params = RouteParameters::from_payment_params_and_value(payment_params, 100);
let payment_params = PaymentParameters::from_node_id(nodes[2], 42)
.with_bolt11_features(channelmanager::provided_bolt11_invoice_features(&config))
.unwrap();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
+
// 100,000 sats is less than the available liquidity on each channel, set above.
let route_params = RouteParameters::from_payment_params_and_value(
payment_params, 100_000_000);
let (secp_ctx, network_graph, _, _, logger) = build_line_graph();
let (_, our_id, _, nodes) = get_nodes(&secp_ctx);
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
-
+ let random_seed_bytes = [42; 32];
let mut scorer_params = ProbabilisticScoringFeeParameters::default();
let scorer = ProbabilisticScorer::new(ProbabilisticScoringDecayParameters::default(), Arc::clone(&network_graph), Arc::clone(&logger));
let netgraph = network_graph.read_only();
let (_, our_id, _, nodes) = get_nodes(&secp_ctx);
let scorer = ln_test_utils::TestScorer::new();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
let config = UserConfig::default();
let max_htlc_msat = 50_000;
let logger = Arc::new(ln_test_utils::TestLogger::new());
let network_graph = Arc::new(NetworkGraph::new(Network::Testnet, Arc::clone(&logger)));
let scorer = ln_test_utils::TestScorer::new();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
let config = UserConfig::default();
let our_node_id = ln_test_utils::pubkey(42);
let network_graph = network.read_only();
let scorer = ln_test_utils::TestScorer::new();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
let mut blinded_path = BlindedPath {
introduction_node: IntroductionNode::NodeId(nodes[2]),
let network_graph = network.read_only();
let scorer = ln_test_utils::TestScorer::new();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
let mut invalid_blinded_path = BlindedPath {
introduction_node: IntroductionNode::NodeId(nodes[2]),
let network_graph = network.read_only();
let scorer = ln_test_utils::TestScorer::new();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
let config = UserConfig::default();
let bolt12_features = channelmanager::provided_bolt12_invoice_features(&config);
let network_graph = Arc::new(NetworkGraph::new(Network::Testnet, Arc::clone(&logger)));
let gossip_sync = P2PGossipSync::new(Arc::clone(&network_graph), None, Arc::clone(&logger));
let scorer = ln_test_utils::TestScorer::new();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
let amt_msat = 10_000_000;
let (_, _, privkeys, nodes) = get_nodes(&secp_ctx);
let logger = Arc::new(ln_test_utils::TestLogger::new());
let network_graph = Arc::new(NetworkGraph::new(Network::Testnet, Arc::clone(&logger)));
let scorer = ln_test_utils::TestScorer::new();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
let config = UserConfig::default();
// Values are taken from the fuzz input that uncovered this panic.
let (secp_ctx, network_graph, _, _, logger) = build_graph();
let (_, our_id, _, nodes) = get_nodes(&secp_ctx);
let scorer = ln_test_utils::TestScorer::new();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
let config = UserConfig::default();
// Values are taken from the fuzz input that uncovered this panic.
let (secp_ctx, network_graph, _, _, logger) = build_graph();
let (_, our_id, _, nodes) = get_nodes(&secp_ctx);
let scorer = ln_test_utils::TestScorer::new();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
let config = UserConfig::default();
// Values are taken from the fuzz input that uncovered this panic.
let logger = Arc::new(ln_test_utils::TestLogger::new());
let network_graph = Arc::new(NetworkGraph::new(Network::Testnet, Arc::clone(&logger)));
let scorer = ln_test_utils::TestScorer::new();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
let config = UserConfig::default();
// Values are taken from the fuzz input that uncovered this panic.
let logger = Arc::new(ln_test_utils::TestLogger::new());
let network_graph = Arc::new(NetworkGraph::new(Network::Testnet, Arc::clone(&logger)));
let scorer = ln_test_utils::TestScorer::new();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
let config = UserConfig::default();
// Values are taken from the fuzz input that uncovered this panic.
let network_graph = Arc::new(NetworkGraph::new(Network::Testnet, Arc::clone(&logger)));
let gossip_sync = P2PGossipSync::new(network_graph.clone(), None, logger.clone());
let scorer = ProbabilisticScorer::new(ProbabilisticScoringDecayParameters::default(), network_graph.clone(), logger.clone());
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
let config = UserConfig::default();
// Values are taken from the fuzz input that uncovered this panic.
let logger = Arc::new(ln_test_utils::TestLogger::new());
let network_graph = Arc::new(NetworkGraph::new(Network::Testnet, Arc::clone(&logger)));
let scorer = ProbabilisticScorer::new(ProbabilisticScoringDecayParameters::default(), network_graph.clone(), logger.clone());
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
let config = UserConfig::default();
// Values are taken from the fuzz input that uncovered this panic.
let network_graph = Arc::new(NetworkGraph::new(Network::Testnet, Arc::clone(&logger)));
let gossip_sync = P2PGossipSync::new(Arc::clone(&network_graph), None, Arc::clone(&logger));
let scorer = ln_test_utils::TestScorer::new();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
let config = UserConfig::default();
let amt_msat = 1_000_000;
let logger = Arc::new(ln_test_utils::TestLogger::new());
let network_graph = Arc::new(NetworkGraph::new(Network::Testnet, Arc::clone(&logger)));
let scorer = ln_test_utils::TestScorer::new();
- let keys_manager = ln_test_utils::TestKeysInterface::new(&[0u8; 32], Network::Testnet);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
let config = UserConfig::default();
let (_, our_node_id, _, nodes) = get_nodes(&secp_ctx);
use crate::chain::transaction::OutPoint;
use crate::routing::scoring::{ProbabilisticScorer, ScoreUpdate};
- use crate::sign::KeysManager;
use crate::ln::channel_state::{ChannelCounterparty, ChannelShutdownState};
use crate::ln::channelmanager;
use crate::ln::types::ChannelId;
starting_amount: u64, route_count: usize,
) -> Vec<(ChannelDetails, PaymentParameters, u64)> {
let payer = payer_pubkey();
- let keys_manager = KeysManager::new(&[0u8; 32], 42, 42);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
let nodes = graph.read_only().nodes().clone();
let mut route_endpoints = Vec::new();
pub mod benches {
use super::*;
use crate::routing::scoring::{ScoreUpdate, ScoreLookUp};
- use crate::sign::{EntropySource, KeysManager};
use crate::ln::channelmanager;
use crate::ln::features::Bolt11InvoiceFeatures;
use crate::routing::gossip::NetworkGraph;
route_endpoints: Vec<(ChannelDetails, PaymentParameters, u64)>,
) {
let payer = bench_utils::payer_pubkey();
- let keys_manager = KeysManager::new(&[0u8; 32], 42, 42);
- let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ let random_seed_bytes = [42; 32];
let mut idx = 0;
bench.bench_function(bench_name, |b| b.iter(|| {