From 3a2888924b97d9bd0fe1dc749ddf1720cc4fc2a2 Mon Sep 17 00:00:00 2001 From: ryardley Date: Sat, 23 Nov 2024 15:19:49 +0700 Subject: [PATCH] Fix formating --- packages/ciphernode/config/src/app_config.rs | 5 ++--- packages/ciphernode/enclave_node/src/aggregator.rs | 3 ++- packages/ciphernode/enclave_node/src/ciphernode.rs | 3 ++- packages/ciphernode/p2p/src/p2p.rs | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/ciphernode/config/src/app_config.rs b/packages/ciphernode/config/src/app_config.rs index 14459642..ec340ccb 100644 --- a/packages/ciphernode/config/src/app_config.rs +++ b/packages/ciphernode/config/src/app_config.rs @@ -72,7 +72,7 @@ pub struct AppConfig { /// Ethereum Address for the node address: Option
, /// A list of libp2p multiaddrs to dial to as peers when joining the network - peers: Vec + peers: Vec, } impl Default for AppConfig { @@ -86,7 +86,7 @@ impl Default for AppConfig { config_file: PathBuf::from("config.yaml"), // ~/.config/enclave/config.yaml cwd: env::current_dir().unwrap_or_default(), peers: vec![], // NOTE: This should remain empty and we should look at config - // generation via ipns fetch for the latest nodes + // generation via ipns fetch for the latest nodes address: None, } } @@ -163,7 +163,6 @@ impl AppConfig { pub fn peers(&self) -> Vec { self.peers.clone() } - } /// Load the config at the config_file or the default location if not provided diff --git a/packages/ciphernode/enclave_node/src/aggregator.rs b/packages/ciphernode/enclave_node/src/aggregator.rs index f2fe23c3..776a865e 100644 --- a/packages/ciphernode/enclave_node/src/aggregator.rs +++ b/packages/ciphernode/enclave_node/src/aggregator.rs @@ -82,7 +82,8 @@ pub async fn setup_aggregator( .build() .await?; - let (_, join_handle, peer_id) = P2p::spawn_libp2p(bus.clone(), config.peers()).expect("Failed to setup libp2p"); + let (_, join_handle, peer_id) = + P2p::spawn_libp2p(bus.clone(), config.peers()).expect("Failed to setup libp2p"); if let Some(path) = pubkey_write_path { PublicKeyWriter::attach(path, bus.clone()); diff --git a/packages/ciphernode/enclave_node/src/ciphernode.rs b/packages/ciphernode/enclave_node/src/ciphernode.rs index 4be5b39d..8b1fb794 100644 --- a/packages/ciphernode/enclave_node/src/ciphernode.rs +++ b/packages/ciphernode/enclave_node/src/ciphernode.rs @@ -71,7 +71,8 @@ pub async fn setup_ciphernode( .build() .await?; - let (_, join_handle, peer_id) = P2p::spawn_libp2p(bus.clone(), config.peers()).expect("Failed to setup libp2p"); + let (_, join_handle, peer_id) = + P2p::spawn_libp2p(bus.clone(), config.peers()).expect("Failed to setup libp2p"); let nm = format!("CIPHER({})", &address.to_string()[0..5]); SimpleLogger::attach(&nm, bus.clone()); diff --git a/packages/ciphernode/p2p/src/p2p.rs b/packages/ciphernode/p2p/src/p2p.rs index ccc71709..e9c482ca 100644 --- a/packages/ciphernode/p2p/src/p2p.rs +++ b/packages/ciphernode/p2p/src/p2p.rs @@ -65,7 +65,7 @@ impl P2p { /// Spawn a Libp2p instance. Calls spawn and listen pub fn spawn_libp2p( bus: Addr, - peers: Vec + peers: Vec, ) -> Result<(Addr, tokio::task::JoinHandle<()>, String), Box> { let (mut libp2p, tx, rx) = EnclaveRouter::new()?; let keypair = libp2p::identity::Keypair::generate_ed25519();