pub reason: Option<ClosureReason>,
}
+impl ExpectedCloseEvent {
+ pub fn from_id_reason(channel_id: ChannelId, discard_funding: bool, reason: ClosureReason) -> Self {
+ Self {
+ channel_capacity_sats: None,
+ channel_id: Some(channel_id),
+ counterparty_node_id: None,
+ discard_funding,
+ reason: Some(reason),
+ }
+ }
+}
+
/// Check that multiple channel closing events have been issued.
pub fn check_closed_events(node: &Node, expected_close_events: &[ExpectedCloseEvent]) {
let closed_events_count = expected_close_events.len();
)
}
+/// Like `get_route` above, but adds a random CLTV offset to the final hop.
+pub fn find_route(send_node: &Node, route_params: &RouteParameters) -> Result<Route, msgs::LightningError> {
+ let scorer = TestScorer::new();
+ let keys_manager = TestKeysInterface::new(&[0u8; 32], bitcoin::network::constants::Network::Testnet);
+ let random_seed_bytes = keys_manager.get_secure_random_bytes();
+ router::find_route(
+ &send_node.node.get_our_node_id(), route_params, &send_node.network_graph,
+ Some(&send_node.node.list_usable_channels().iter().collect::<Vec<_>>()),
+ send_node.logger, &scorer, &Default::default(), &random_seed_bytes
+ )
+}
+
/// Gets a route from the given sender to the node described in `payment_params`.
///
/// Don't use this, use the identically-named function instead.