Skip to content

Commit

Permalink
feat: remove unused structs
Browse files Browse the repository at this point in the history
  • Loading branch information
kgmyatthu committed Dec 30, 2024
1 parent 98da33b commit 570df84
Showing 1 changed file with 1 addition and 37 deletions.
38 changes: 1 addition & 37 deletions src/liberdus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,6 @@ pub struct Signature {
pub owner: String,
pub sig: String,
}
#[derive(serde::Deserialize, serde::Serialize)]
pub struct TxInjectResp{
pub result: Option<TxInjectRespInner>,
pub error: Option<serde_json::Value>
}

#[derive(serde::Deserialize, serde::Serialize)]
pub struct TxInjectRespInner{
pub reason: String,
pub status: u32,
pub success: bool,
#[allow(non_snake_case)]
pub txId: Option<String>,
}

pub struct Liberdus {
pub active_nodelist: Arc<RwLock<Vec<Consensor>>>,
Expand All @@ -61,29 +47,6 @@ pub struct Liberdus {
config: Arc<config::Config>,
}

#[derive(serde::Deserialize, serde::Serialize)]
pub struct GetAccountResp{
account: serde_json::Value,
}

#[derive(serde::Deserialize, serde::Serialize)]
pub struct GetTransactionResp{
#[serde(skip_serializing_if = "Option::is_none")]
account: Option<serde_json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
transaction: Option<serde_json::Value>,
}

#[derive(serde::Deserialize, serde::Serialize)]
pub struct ChatAccount {
hash: String,
id: String,
messages: Vec<serde_json::Value>,
timestamp: u128,
#[serde(rename = "type")] // Map JSON "type" to the Rust field "type_field"
type_field: String,
}

impl Liberdus {
pub fn new (sc: Arc<crypto::ShardusCrypto>, archivers: Arc<RwLock<Vec<archivers::Archiver>>>, config: config::Config) -> Self{
Liberdus{
Expand All @@ -100,6 +63,7 @@ impl Liberdus {

}

/// trigger a full nodelist update from one of the archivers
pub async fn update_active_nodelist(&self){

let archivers = self.archivers.read().await;
Expand Down

0 comments on commit 570df84

Please sign in to comment.