Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ryardley committed Nov 29, 2024
1 parent ae88643 commit e841fb3
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 31 deletions.
9 changes: 4 additions & 5 deletions packages/ciphernode/data/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
mod data_store;
mod in_mem;
mod into_key;
mod repository;
mod persistable;
mod repositories;
mod repository;
mod sled_store;
mod snapshot;
mod persistable;

pub use data_store::*;
pub use in_mem::*;
pub use into_key::IntoKey;
pub use repository::*;
pub use persistable::*;
pub use repositories::*;
pub use repository::*;
pub use sled_store::*;
pub use snapshot::*;
pub use persistable::*;

10 changes: 2 additions & 8 deletions packages/ciphernode/data/src/persistable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,8 @@ use anyhow::*;
use async_trait::async_trait;
use serde::{de::DeserializeOwned, Serialize};

pub trait PersistableData:
Serialize + DeserializeOwned + Clone + Send + Sync + 'static
{
}
impl<T> PersistableData for T where
T: Serialize + DeserializeOwned + Clone + Send + Sync + 'static
{
}
pub trait PersistableData: Serialize + DeserializeOwned + Clone + Send + Sync + 'static {}
impl<T> PersistableData for T where T: Serialize + DeserializeOwned + Clone + Send + Sync + 'static {}

/// AutoPersist enables a repository to generate a persistable container
#[async_trait]
Expand Down
6 changes: 3 additions & 3 deletions packages/ciphernode/data/src/snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ pub trait Checkpoint: Snapshot {

/// Write the current snapshot to the `Repository` provided by `repository()`
fn checkpoint(&self) {
let snapshot = match self.snapshot() {
let snapshot = match self.snapshot() {
Ok(v) => v,
Err(err) => {
error!("Not saving data because '{}'",err);
error!("Not saving data because '{}'", err);
return;
}
};

self.repository().write(&snapshot);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/ciphernode/enclave_node/src/datastore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use actix::{Actor, Addr};
use anyhow::Result;
use config::AppConfig;
use data::{DataStore, InMemStore, SledStore};
use enclave_core::EventBus;
use data::{Repositories, RepositoriesFactory};
use enclave_core::EventBus;

pub fn get_sled_store(bus: &Addr<EventBus>, db_file: &PathBuf) -> Result<DataStore> {
Ok((&SledStore::new(bus, db_file)?).into())
Expand Down
6 changes: 1 addition & 5 deletions packages/ciphernode/evm/src/repositories.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ pub trait EnclaveSolReaderRepositoryFactory {

impl EnclaveSolReaderRepositoryFactory for Repositories {
fn enclave_sol_reader(&self, chain_id: u64) -> Repository<EvmEventReaderState> {
Repository::new(
self.store
.scope(StoreKeys::enclave_sol_reader(chain_id)),
)
Repository::new(self.store.scope(StoreKeys::enclave_sol_reader(chain_id)))
}
}

Expand All @@ -38,4 +35,3 @@ impl CiphernodeRegistryReaderRepositoryFactory for Repositories {
)
}
}

4 changes: 2 additions & 2 deletions packages/ciphernode/fhe/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
mod fhe;
mod utils;
mod repositories;
mod utils;

pub use fhe::*;
pub use utils::*;
pub use repositories::*;
pub use utils::*;
1 change: 0 additions & 1 deletion packages/ciphernode/fhe/src/repositories.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

use config::StoreKeys;
use data::{Repositories, Repository};
use enclave_core::E3id;
Expand Down
3 changes: 1 addition & 2 deletions packages/ciphernode/router/src/committee_meta.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{E3Feature, E3RequestContext, E3RequestContextSnapshot, MetaRepositoryFactory};
use data::RepositoriesFactory;
use anyhow::*;
use async_trait::async_trait;
use data::RepositoriesFactory;
use enclave_core::{E3Requested, EnclaveEvent, Seed};

#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
Expand Down Expand Up @@ -65,4 +65,3 @@ impl E3Feature for CommitteeMetaFeature {
Ok(())
}
}

4 changes: 2 additions & 2 deletions packages/ciphernode/router/src/e3_request_router.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
use crate::CommitteeMetaFeature;
use crate::ContextRepositoryFactory;
use crate::E3RequestContext;
use crate::E3RequestContextParams;
use crate::E3RequestContextSnapshot;
use crate::RouterRepositoryFactory;
use crate::ContextRepositoryFactory;
use actix::AsyncContext;
use actix::{Actor, Addr, Context, Handler};
use anyhow::*;
use async_trait::async_trait;
use data::Checkpoint;
use data::DataStore;
use data::RepositoriesFactory;
use data::FromSnapshotWithParams;
use data::RepositoriesFactory;
use data::Repository;
use data::Snapshot;
use enclave_core::E3RequestComplete;
Expand Down
4 changes: 2 additions & 2 deletions packages/ciphernode/sortition/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

mod distance;
mod index;
mod sortition;
mod repositories;
mod sortition;

pub use distance::*;
pub use index::*;
pub use sortition::*;
pub use repositories::*;
pub use sortition::*;

0 comments on commit e841fb3

Please sign in to comment.