more refactor

This commit is contained in:
John Smith
2023-02-25 19:51:14 -05:00
parent 7962d3fe11
commit 4bc3f950df
17 changed files with 587 additions and 529 deletions

View File

@@ -22,7 +22,7 @@ pub enum Destination {
/// Send to private route (privateroute)
PrivateRoute {
/// A private route set id to send to
private_route: String,
private_route_id: RouteId,
/// Require safety route or not
safety_selection: SafetySelection,
},
@@ -44,9 +44,9 @@ impl Destination {
safety_selection: SafetySelection::Unsafe(sequencing),
}
}
pub fn private_route(private_route: PrivateRoute, safety_selection: SafetySelection) -> Self {
pub fn private_route(private_route_id: RouteId, safety_selection: SafetySelection) -> Self {
Self::PrivateRoute {
private_route,
private_route_id,
safety_selection,
}
}
@@ -70,10 +70,10 @@ impl Destination {
safety_selection,
},
Destination::PrivateRoute {
private_route,
private_route_id,
safety_selection: _,
} => Self::PrivateRoute {
private_route,
private_route_id,
safety_selection,
},
}
@@ -91,7 +91,7 @@ impl Destination {
safety_selection,
} => safety_selection,
Destination::PrivateRoute {
private_route: _,
private_route_id: _,
safety_selection,
} => safety_selection,
}
@@ -127,7 +127,7 @@ impl fmt::Display for Destination {
write!(f, "{}@{}{}", target, relay, sr)
}
Destination::PrivateRoute {
private_route,
private_route_id,
safety_selection,
} => {
let sr = if matches!(safety_selection, SafetySelection::Safe(_)) {
@@ -136,7 +136,7 @@ impl fmt::Display for Destination {
""
};
write!(f, "{}{}", private_route, sr)
write!(f, "{}{}", private_route_id, sr)
}
}
}
@@ -207,7 +207,7 @@ impl RPCProcessor {
}
},
Destination::PrivateRoute {
private_route,
private_route_id,
safety_selection,
} => {
let Some(avoid_node_id) = private_route.first_hop_node_id() else {

View File

@@ -674,7 +674,7 @@ impl RPCProcessor {
};
}
Destination::PrivateRoute {
private_route,
private_route_id,
safety_selection,
} => {
// Send to private route
@@ -726,7 +726,7 @@ impl RPCProcessor {
}
}
Destination::PrivateRoute {
private_route: _,
private_route_id: _,
safety_selection: _,
} => {
return Ok(SenderPeerInfo::default());

View File

@@ -17,7 +17,7 @@ impl RPCProcessor {
if matches!(
dest,
Destination::PrivateRoute {
private_route: _,
private_route_id: _,
safety_selection: _
}
) {

View File

@@ -13,7 +13,7 @@ impl RPCProcessor {
if matches!(
dest,
Destination::PrivateRoute {
private_route: _,
private_route_id: _,
safety_selection: _
}
) {

View File

@@ -53,7 +53,7 @@ impl RPCProcessor {
(Some(target.clone()), routing_domain)
}
Destination::PrivateRoute {
private_route: _,
private_route_id: _,
safety_selection: _,
} => (None, RoutingDomain::PublicInternet),
};
@@ -169,7 +169,7 @@ impl RPCProcessor {
safety_selection: _,
}
| Destination::PrivateRoute {
private_route: _,
private_route_id: _,
safety_selection: _,
} => {
// sender info is irrelevant over relays and routes