This commit is contained in:
mfahampshire
2025-11-07 18:13:24 +00:00
parent e6f9b551ed
commit 70bdbce23f
5 changed files with 6 additions and 11 deletions
+1
View File
@@ -139,6 +139,7 @@ pub enum Error {
#[error("connect denied: {0:?}")]
ConnectDenied(ConnectFailureReason),
#[allow(clippy::result_large_err)]
#[error("api directory error: {0}")]
GatewayDirectoryError(#[from] NymAPIError),
@@ -94,7 +94,7 @@ impl IprClientConnect {
let surbs = 20;
self.mixnet_sender
.send(create_input_message(
Recipient::from(ip_packet_router_address),
ip_packet_router_address,
request,
surbs,
))
@@ -365,7 +365,7 @@ impl MixStream {
debug!("Loading env file: {:?}", env);
setup_env(Some(env.clone()));
let socket = MixSocket::new(env).await?;
Ok(socket.connect(peer).await?)
socket.connect(peer).await
}
/// Get the peer's Nym address (like `TcpStream::peer_addr`).
@@ -6,7 +6,6 @@ use super::network_env::NetworkEnvironment;
use crate::ip_packet_client::{
helpers::check_ipr_message_version, IprListener, MixnetMessageOutcome,
};
use crate::UserAgent;
use crate::{mixnet::Recipient, Error};
use std::collections::HashMap;
@@ -1,7 +1,8 @@
use std::path::PathBuf;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[derive(Default, Debug, Clone, Copy, PartialEq, Eq)]
pub enum NetworkEnvironment {
#[default]
Mainnet,
// Sandbox,
}
@@ -21,7 +22,7 @@ impl NetworkEnvironment {
}
}
pub fn from_str(s: &str) -> Result<Self, String> {
pub fn parse_network(s: &str) -> Result<Self, String> {
match s.to_lowercase().as_str() {
"mainnet" | "main" => Ok(Self::Mainnet),
// "sandbox" | "sand" => Ok(Self::Sandbox),
@@ -29,9 +30,3 @@ impl NetworkEnvironment {
}
}
}
impl Default for NetworkEnvironment {
fn default() -> Self {
Self::Mainnet
}
}