Sort endpoints in CircuitNode in AdminServiceStore
CircuitNode/AdminServiceStore did not previously enforce
any order on the endpoints and does not store a position.
This can be sorted for consistently. This does not effect
any previous expected format and these are not used for
hashing, so they can be safely sorted.
@@ -136,12 +136,14 @@ impl CircuitNodeBuilder {
InvalidStateError::with_message("unable to build, missing field: `node_id`".to_string())
})?;
- let endpoints = self.endpoints.ok_or_else(|| {
+ let mut endpoints = self.endpoints.ok_or_else(|| {
InvalidStateError::with_message(
"unable to build, missing field: `endpoints`".to_string(),
)
})?;
+ endpoints.sort();
+
let node = CircuitNode {
id: node_id,
endpoints,
