You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A payee can be identified by a pubkey and optionally have an associated
set of invoice features and route hints. Use this in get_route instead
of three separate parameters. This may be included in PaymentPathFailed
later to use when finding a new route.
// Next, attempt a keysend payment and make sure it fails.
6077
-
let route = get_route(&nodes[0].node.get_our_node_id(),&nodes[0].net_graph_msg_handler.network_graph,&expected_route.last().unwrap().node.get_our_node_id(),Some(InvoiceFeatures::known()),None,&Vec::new(),100_000,TEST_FINAL_CLTV,&logger,&scorer).unwrap();
6077
+
let payee = Payee::new(expected_route.last().unwrap().node.get_our_node_id())
6078
+
.with_features(InvoiceFeatures::known());
6079
+
let route = get_route(&nodes[0].node.get_our_node_id(),&payee,&nodes[0].net_graph_msg_handler.network_graph,None,100_000,TEST_FINAL_CLTV,&logger,&scorer).unwrap();
// To start (2), send a keysend payment but don't claim it.
6104
6106
let payment_preimage = PaymentPreimage([42;32]);
6105
-
let route = get_route(&nodes[0].node.get_our_node_id(),&nodes[0].net_graph_msg_handler.network_graph,&expected_route.last().unwrap().node.get_our_node_id(),Some(InvoiceFeatures::known()),None,&Vec::new(),100_000,TEST_FINAL_CLTV,&logger,&scorer).unwrap();
6107
+
let route = get_route(&nodes[0].node.get_our_node_id(),&payee,&nodes[0].net_graph_msg_handler.network_graph,None,100_000,TEST_FINAL_CLTV,&logger,&scorer).unwrap();
let route = get_route(&nodes[0].node.get_our_node_id(),&nodes[0].net_graph_msg_handler.network_graph,&nodes[1].node.get_our_node_id(),Some(InvoiceFeatures::known()),None,&Vec::new(),10_000,TEST_FINAL_CLTV, nodes[0].logger,&scorer).unwrap();
7302
+
let payee = Payee::new(nodes[1].node.get_our_node_id()).with_features(InvoiceFeatures::known());
7303
+
let route = get_route(&nodes[0].node.get_our_node_id(),&payee,&nodes[0].net_graph_msg_handler.network_graph,None,10_000,TEST_FINAL_CLTV, nodes[0].logger,&scorer).unwrap();
Copy file name to clipboardExpand all lines: lightning/src/ln/shutdown_tests.rs
+5-3
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ use chain::keysinterface::KeysInterface;
13
13
use chain::transaction::OutPoint;
14
14
use ln::{PaymentPreimage,PaymentHash};
15
15
use ln::channelmanager::PaymentSendFailure;
16
-
use routing::router::get_route;
16
+
use routing::router::{Payee,get_route};
17
17
use routing::network_graph::NetworkUpdate;
18
18
use routing::scorer::Scorer;
19
19
use ln::features::{InitFeatures,InvoiceFeatures};
@@ -99,8 +99,10 @@ fn updates_shutdown_wait() {
99
99
100
100
let net_graph_msg_handler0 = &nodes[0].net_graph_msg_handler;
101
101
let net_graph_msg_handler1 = &nodes[1].net_graph_msg_handler;
102
-
let route_1 = get_route(&nodes[0].node.get_our_node_id(),&net_graph_msg_handler0.network_graph,&nodes[1].node.get_our_node_id(),Some(InvoiceFeatures::known()),None,&[],100000,TEST_FINAL_CLTV,&logger,&scorer).unwrap();
103
-
let route_2 = get_route(&nodes[1].node.get_our_node_id(),&net_graph_msg_handler1.network_graph,&nodes[0].node.get_our_node_id(),Some(InvoiceFeatures::known()),None,&[],100000,TEST_FINAL_CLTV,&logger,&scorer).unwrap();
102
+
let payee_1 = Payee::new(nodes[1].node.get_our_node_id()).with_features(InvoiceFeatures::known());
103
+
let route_1 = get_route(&nodes[0].node.get_our_node_id(),&payee_1,&net_graph_msg_handler0.network_graph,None,100000,TEST_FINAL_CLTV,&logger,&scorer).unwrap();
104
+
let payee_2 = Payee::new(nodes[0].node.get_our_node_id()).with_features(InvoiceFeatures::known());
105
+
let route_2 = get_route(&nodes[1].node.get_our_node_id(),&payee_2,&net_graph_msg_handler1.network_graph,None,100000,TEST_FINAL_CLTV,&logger,&scorer).unwrap();
0 commit comments