X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fln%2Fpriv_short_conf_tests.rs;h=cfcc46dfedace4a7048341ad495ca437ae9b1122;hb=0ecb4b093ac1134cbf06275cc48dd79ef7524774;hp=7bb1fd44f2fe1f6d42698a222d47039f431d91be;hpb=f1761e06e6b44cedb1e1a9886b96c6723cdad2f3;p=rust-lightning diff --git a/lightning/src/ln/priv_short_conf_tests.rs b/lightning/src/ln/priv_short_conf_tests.rs index 7bb1fd44..cfcc46df 100644 --- a/lightning/src/ln/priv_short_conf_tests.rs +++ b/lightning/src/ln/priv_short_conf_tests.rs @@ -12,7 +12,7 @@ //! LSP). use crate::chain::ChannelMonitorUpdateStatus; -use crate::chain::keysinterface::NodeSigner; +use crate::sign::NodeSigner; use crate::events::{ClosureReason, Event, HTLCDestination, MessageSendEvent, MessageSendEventsProvider}; use crate::ln::channelmanager::{ChannelManager, MIN_CLTV_EXPIRY_DELTA, PaymentId, RecipientOnionFields}; use crate::routing::gossip::RoutingFees; @@ -67,9 +67,9 @@ fn test_priv_forwarding_rejection() { }]); let last_hops = vec![route_hint]; let payment_params = PaymentParameters::from_node_id(nodes[2].node.get_our_node_id(), TEST_FINAL_CLTV) - .with_features(nodes[2].node.invoice_features()) - .with_route_hints(last_hops); - let (route, our_payment_hash, our_payment_preimage, our_payment_secret) = get_route_and_payment_hash!(nodes[0], nodes[2], payment_params, 10_000, TEST_FINAL_CLTV); + .with_bolt11_features(nodes[2].node.invoice_features()).unwrap() + .with_route_hints(last_hops).unwrap(); + let (route, our_payment_hash, our_payment_preimage, our_payment_secret) = get_route_and_payment_hash!(nodes[0], nodes[2], payment_params, 10_000); nodes[0].node.send_payment_with_route(&route, our_payment_hash, RecipientOnionFields::secret_only(our_payment_secret), PaymentId(our_payment_hash.0)).unwrap(); @@ -236,9 +236,9 @@ fn test_routed_scid_alias() { htlc_minimum_msat: None, }])]; let payment_params = PaymentParameters::from_node_id(nodes[2].node.get_our_node_id(), 42) - .with_features(nodes[2].node.invoice_features()) - .with_route_hints(hop_hints); - let (route, payment_hash, payment_preimage, payment_secret) = get_route_and_payment_hash!(nodes[0], nodes[2], payment_params, 100_000, 42); + .with_bolt11_features(nodes[2].node.invoice_features()).unwrap() + .with_route_hints(hop_hints).unwrap(); + let (route, payment_hash, payment_preimage, payment_secret) = get_route_and_payment_hash!(nodes[0], nodes[2], payment_params, 100_000); assert_eq!(route.paths[0].hops[1].short_channel_id, last_hop[0].inbound_scid_alias.unwrap()); nodes[0].node.send_payment_with_route(&route, payment_hash, RecipientOnionFields::secret_only(payment_secret), PaymentId(payment_hash.0)).unwrap(); @@ -402,9 +402,9 @@ fn test_inbound_scid_privacy() { htlc_minimum_msat: None, }])]; let payment_params = PaymentParameters::from_node_id(nodes[2].node.get_our_node_id(), 42) - .with_features(nodes[2].node.invoice_features()) - .with_route_hints(hop_hints.clone()); - let (route, payment_hash, payment_preimage, payment_secret) = get_route_and_payment_hash!(nodes[0], nodes[2], payment_params, 100_000, 42); + .with_bolt11_features(nodes[2].node.invoice_features()).unwrap() + .with_route_hints(hop_hints.clone()).unwrap(); + let (route, payment_hash, payment_preimage, payment_secret) = get_route_and_payment_hash!(nodes[0], nodes[2], payment_params, 100_000); assert_eq!(route.paths[0].hops[1].short_channel_id, last_hop[0].inbound_scid_alias.unwrap()); nodes[0].node.send_payment_with_route(&route, payment_hash, RecipientOnionFields::secret_only(payment_secret), PaymentId(payment_hash.0)).unwrap(); @@ -418,9 +418,9 @@ fn test_inbound_scid_privacy() { hop_hints[0].0[0].short_channel_id = last_hop[0].short_channel_id.unwrap(); let payment_params_2 = PaymentParameters::from_node_id(nodes[2].node.get_our_node_id(), 42) - .with_features(nodes[2].node.invoice_features()) - .with_route_hints(hop_hints); - let (route_2, payment_hash_2, _, payment_secret_2) = get_route_and_payment_hash!(nodes[0], nodes[2], payment_params_2, 100_000, 42); + .with_bolt11_features(nodes[2].node.invoice_features()).unwrap() + .with_route_hints(hop_hints).unwrap(); + let (route_2, payment_hash_2, _, payment_secret_2) = get_route_and_payment_hash!(nodes[0], nodes[2], payment_params_2, 100_000); assert_eq!(route_2.paths[0].hops[1].short_channel_id, last_hop[0].short_channel_id.unwrap()); nodes[0].node.send_payment_with_route(&route_2, payment_hash_2, RecipientOnionFields::secret_only(payment_secret_2), PaymentId(payment_hash_2.0)).unwrap(); @@ -470,9 +470,9 @@ fn test_scid_alias_returned() { htlc_minimum_msat: None, }])]; let payment_params = PaymentParameters::from_node_id(nodes[2].node.get_our_node_id(), 42) - .with_features(nodes[2].node.invoice_features()) - .with_route_hints(hop_hints); - let (mut route, payment_hash, _, payment_secret) = get_route_and_payment_hash!(nodes[0], nodes[2], payment_params, 10_000, 42); + .with_bolt11_features(nodes[2].node.invoice_features()).unwrap() + .with_route_hints(hop_hints).unwrap(); + let (mut route, payment_hash, _, payment_secret) = get_route_and_payment_hash!(nodes[0], nodes[2], payment_params, 10_000); assert_eq!(route.paths[0].hops[1].short_channel_id, nodes[2].node.list_usable_channels()[0].inbound_scid_alias.unwrap()); route.paths[0].hops[1].fee_msat = 10_000_000; // Overshoot the last channel's value