- let (payment_preimage, payment_hash, payment_secret) = get_payment_preimage_hash!($recv_node);
- let net_graph_msg_handler = &$send_node.net_graph_msg_handler;
- let route = get_route(&$send_node.node.get_our_node_id(),
- &net_graph_msg_handler.network_graph,
- &$recv_node.node.get_our_node_id(), None, None, &Vec::new(), $recv_value, TEST_FINAL_CLTV, $send_node.logger).unwrap();
+ $crate::get_route_and_payment_hash!($send_node, $recv_node, vec![], $recv_value, TEST_FINAL_CLTV)
+ }};
+ ($send_node: expr, $recv_node: expr, $last_hops: expr, $recv_value: expr, $cltv: expr) => {{
+ let (payment_preimage, payment_hash, payment_secret) = $crate::get_payment_preimage_hash!($recv_node, Some($recv_value));
+ let payee = $crate::routing::router::Payee::from_node_id($recv_node.node.get_our_node_id())
+ .with_features($crate::ln::features::InvoiceFeatures::known())
+ .with_route_hints($last_hops);
+ let scorer = $crate::util::test_utils::TestScorer::with_fixed_penalty(0);
+ let route = $crate::routing::router::get_route(
+ &$send_node.node.get_our_node_id(), &payee, $send_node.network_graph,
+ Some(&$send_node.node.list_usable_channels().iter().collect::<Vec<_>>()),
+ $recv_value, $cltv, $send_node.logger, &scorer
+ ).unwrap();