Vendor asic-rs 0.8.1 (280 crates, offline builds) + wxWidgets 3.3.3 (pristine + patch queue); UI spec + ADR-0003; M1 on asic-rs

This commit is contained in:
2026-09-15 10:41:00 -06:00
parent 6dc77e8eb0
commit a2b65bb47f
16427 changed files with 6972976 additions and 3 deletions
+55
View File
@@ -0,0 +1,55 @@
use serde::{Deserialize, Serialize};
use serde_json::Value;
use crate::errors::RPCError;
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum MinerCommand {
RPC {
command: &'static str,
parameters: Option<Value>,
},
GRPC {
command: &'static str,
},
WebAPI {
command: &'static str,
parameters: Option<Value>,
},
GraphQL {
command: &'static str,
},
SSH {
command: &'static str,
},
}
#[derive(Debug)]
pub enum RPCCommandStatus {
Success,
Information,
Error(String),
Unknown,
}
impl RPCCommandStatus {
pub fn into_result(self) -> Result<(), RPCError> {
match self {
RPCCommandStatus::Success => Ok(()),
RPCCommandStatus::Information => Ok(()),
RPCCommandStatus::Error(msg) => Err(RPCError::StatusCheckFailed(msg)),
RPCCommandStatus::Unknown => {
Err(RPCError::StatusCheckFailed(String::from("Unknown status")))
}
}
}
pub fn from_str(response: &str, message: Option<&str>) -> Self {
match response {
"S" => RPCCommandStatus::Success,
"I" => RPCCommandStatus::Information,
"E" => RPCCommandStatus::Error(message.unwrap_or("Unknown error").to_string()),
_ => RPCCommandStatus::Unknown,
}
}
}