From a622315a9a3685f2075b2862808986b79b96eadc Mon Sep 17 00:00:00 2001 From: ryardley Date: Mon, 2 Dec 2024 14:34:05 +0700 Subject: [PATCH] Formatting --- packages/ciphernode/enclave_node/src/aggregator.rs | 8 +++++++- packages/ciphernode/enclave_node/src/ciphernode.rs | 8 +++++++- packages/ciphernode/net/src/lib.rs | 4 ++-- packages/ciphernode/net/src/network_manager.rs | 2 +- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/packages/ciphernode/enclave_node/src/aggregator.rs b/packages/ciphernode/enclave_node/src/aggregator.rs index 441d9c0e..1cfbfbdf 100644 --- a/packages/ciphernode/enclave_node/src/aggregator.rs +++ b/packages/ciphernode/enclave_node/src/aggregator.rs @@ -81,7 +81,13 @@ pub async fn setup_aggregator( .build() .await?; - let (_, join_handle, peer_id) = NetworkManager::setup_with_peer(bus.clone(), config.peers(), &cipher, repositories.libp2pid()).await?; + let (_, join_handle, peer_id) = NetworkManager::setup_with_peer( + bus.clone(), + config.peers(), + &cipher, + repositories.libp2pid(), + ) + .await?; 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 8ba67831..4e760614 100644 --- a/packages/ciphernode/enclave_node/src/ciphernode.rs +++ b/packages/ciphernode/enclave_node/src/ciphernode.rs @@ -73,7 +73,13 @@ pub async fn setup_ciphernode( .build() .await?; - let (_, join_handle, peer_id) = NetworkManager::setup_with_peer(bus.clone(), config.peers(), &cipher, repositories.libp2pid()).await?; + let (_, join_handle, peer_id) = NetworkManager::setup_with_peer( + bus.clone(), + config.peers(), + &cipher, + repositories.libp2pid(), + ) + .await?; let nm = format!("CIPHER({})", &address.to_string()[0..5]); SimpleLogger::attach(&nm, bus.clone()); diff --git a/packages/ciphernode/net/src/lib.rs b/packages/ciphernode/net/src/lib.rs index 429a5b56..42f3da11 100644 --- a/packages/ciphernode/net/src/lib.rs +++ b/packages/ciphernode/net/src/lib.rs @@ -1,8 +1,8 @@ #![crate_name = "net"] #![crate_type = "lib"] -mod network_peer; mod network_manager; +mod network_peer; -pub use network_peer::*; pub use network_manager::*; +pub use network_peer::*; diff --git a/packages/ciphernode/net/src/network_manager.rs b/packages/ciphernode/net/src/network_manager.rs index a7af3352..3f687527 100644 --- a/packages/ciphernode/net/src/network_manager.rs +++ b/packages/ciphernode/net/src/network_manager.rs @@ -84,7 +84,7 @@ impl NetworkManager { info!("Generated new keypair {}", kp.public().to_peer_id()); let innerkp = kp.try_into_ed25519()?; let bytes = innerkp.to_bytes().to_vec(); - + repository.write(&cipher.encrypt_data(&mut bytes.clone())?); info!("Saved new keypair to repository"); bytes