From edea81fee0a679508eb107d48837c0eefa571646 Mon Sep 17 00:00:00 2001 From: ryardley Date: Fri, 1 Nov 2024 10:06:24 +1100 Subject: [PATCH] Formatting --- packages/ciphernode/enclave_node/src/aggregator.rs | 12 ++++++++++-- packages/ciphernode/enclave_node/src/ciphernode.rs | 8 ++++++-- .../ciphernode/evm/src/ciphernode_registry_sol.rs | 6 +++++- packages/ciphernode/evm/src/helpers.rs | 1 - 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/packages/ciphernode/enclave_node/src/aggregator.rs b/packages/ciphernode/enclave_node/src/aggregator.rs index b1a62239..94f3c19e 100644 --- a/packages/ciphernode/enclave_node/src/aggregator.rs +++ b/packages/ciphernode/enclave_node/src/aggregator.rs @@ -47,8 +47,16 @@ pub async fn setup_aggregator( { let rpc_url = &chain.rpc_url; let read_provider = create_readonly_provider(&ensure_ws_rpc(rpc_url)).await?; - let write_provider = create_provider_with_signer(&ensure_http_rpc(rpc_url), &signer).await?; - EnclaveSol::attach(&bus, &read_provider, &write_provider, &chain.contracts.enclave, &signer).await?; + let write_provider = + create_provider_with_signer(&ensure_http_rpc(rpc_url), &signer).await?; + EnclaveSol::attach( + &bus, + &read_provider, + &write_provider, + &chain.contracts.enclave, + &signer, + ) + .await?; RegistryFilterSol::attach(&bus, &write_provider, &chain.contracts.filter_registry).await?; CiphernodeRegistrySol::attach(&bus, &read_provider, &chain.contracts.ciphernode_registry) .await?; diff --git a/packages/ciphernode/enclave_node/src/ciphernode.rs b/packages/ciphernode/enclave_node/src/ciphernode.rs index 74c00cdc..2840429e 100644 --- a/packages/ciphernode/enclave_node/src/ciphernode.rs +++ b/packages/ciphernode/enclave_node/src/ciphernode.rs @@ -5,7 +5,10 @@ use cipher::Cipher; use config::AppConfig; use data::{DataStore, InMemStore, SledStore}; use enclave_core::EventBus; -use evm::{helpers::{create_readonly_provider, ensure_ws_rpc}, CiphernodeRegistrySol, EnclaveSolReader}; +use evm::{ + helpers::{create_readonly_provider, ensure_ws_rpc}, + CiphernodeRegistrySol, EnclaveSolReader, +}; use logger::SimpleLogger; use p2p::P2p; use rand::SeedableRng; @@ -44,7 +47,8 @@ pub async fn setup_ciphernode( let read_provider = create_readonly_provider(&ensure_ws_rpc(rpc_url)).await?; EnclaveSolReader::attach(&bus, &read_provider, &chain.contracts.enclave).await?; - CiphernodeRegistrySol::attach(&bus, &read_provider, &chain.contracts.ciphernode_registry).await?; + CiphernodeRegistrySol::attach(&bus, &read_provider, &chain.contracts.ciphernode_registry) + .await?; } E3RequestRouter::builder(&bus, store.clone()) diff --git a/packages/ciphernode/evm/src/ciphernode_registry_sol.rs b/packages/ciphernode/evm/src/ciphernode_registry_sol.rs index 08745653..b4980398 100644 --- a/packages/ciphernode/evm/src/ciphernode_registry_sol.rs +++ b/packages/ciphernode/evm/src/ciphernode_registry_sol.rs @@ -107,7 +107,11 @@ impl CiphernodeRegistrySolReader { pub struct CiphernodeRegistrySol; impl CiphernodeRegistrySol { - pub async fn attach(bus: &Addr, provider: &ReadonlyProvider, contract_address: &str) -> Result<()> { + pub async fn attach( + bus: &Addr, + provider: &ReadonlyProvider, + contract_address: &str, + ) -> Result<()> { CiphernodeRegistrySolReader::attach(bus, provider, contract_address).await?; Ok(()) } diff --git a/packages/ciphernode/evm/src/helpers.rs b/packages/ciphernode/evm/src/helpers.rs index f8f6047f..36a5d6f1 100644 --- a/packages/ciphernode/evm/src/helpers.rs +++ b/packages/ciphernode/evm/src/helpers.rs @@ -66,7 +66,6 @@ pub async fn stream_from_evm( info!("Exiting stream loop"); } - /// We need to cache the chainId so we can easily use it in a non-async situation /// This wrapper just stores the chain_id with the Provider #[derive(Clone)]