From a3615169a05f6c5fbf6038722a897c9f68e66c7f Mon Sep 17 00:00:00 2001 From: ryardley Date: Mon, 7 Oct 2024 13:58:25 +1100 Subject: [PATCH] Formatting --- .../ciphernode/aggregator/src/publickey_aggregator.rs | 5 ++--- packages/ciphernode/core/src/events.rs | 2 +- packages/ciphernode/evm/src/ciphernode_registry_sol.rs | 7 +++++-- packages/ciphernode/evm/src/enclave_sol_reader.rs | 1 - packages/ciphernode/evm/src/helpers.rs | 2 +- packages/ciphernode/evm/src/lib.rs | 8 ++++---- packages/ciphernode/evm/src/registry_filter_sol.rs | 6 +++++- .../tests/tests/test_aggregation_and_decryption.rs | 4 +++- 8 files changed, 21 insertions(+), 14 deletions(-) diff --git a/packages/ciphernode/aggregator/src/publickey_aggregator.rs b/packages/ciphernode/aggregator/src/publickey_aggregator.rs index 2b2cf3b9..56fa326c 100644 --- a/packages/ciphernode/aggregator/src/publickey_aggregator.rs +++ b/packages/ciphernode/aggregator/src/publickey_aggregator.rs @@ -166,7 +166,7 @@ impl Handler for PublicKeyAggregator { if let PublicKeyAggregatorState::Computing { keyshares } = &act.state { ctx.notify(ComputeAggregate { keyshares: keyshares.clone(), - e3_id + e3_id, }) } @@ -207,7 +207,7 @@ impl Handler for PublicKeyAggregator { let event = EnclaveEvent::from(PublicKeyAggregated { pubkey: msg.pubkey.clone(), e3_id: msg.e3_id.clone(), - nodes: OrderedSet::from(nodes) + nodes: OrderedSet::from(nodes), }); act.bus.do_send(event); Ok(()) @@ -215,4 +215,3 @@ impl Handler for PublicKeyAggregator { ) } } - diff --git a/packages/ciphernode/core/src/events.rs b/packages/ciphernode/core/src/events.rs index 61468d5f..869fac72 100644 --- a/packages/ciphernode/core/src/events.rs +++ b/packages/ciphernode/core/src/events.rs @@ -309,7 +309,7 @@ pub struct DecryptionshareCreated { pub struct PublicKeyAggregated { pub pubkey: Vec, pub e3_id: E3id, - pub nodes: OrderedSet + pub nodes: OrderedSet, } #[derive(Message, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] diff --git a/packages/ciphernode/evm/src/ciphernode_registry_sol.rs b/packages/ciphernode/evm/src/ciphernode_registry_sol.rs index c53eb509..204939c5 100644 --- a/packages/ciphernode/evm/src/ciphernode_registry_sol.rs +++ b/packages/ciphernode/evm/src/ciphernode_registry_sol.rs @@ -113,7 +113,6 @@ impl CiphernodeRegistrySolReader { contract_address: Address, rpc_url: &str, ) -> Result { - let provider = create_readonly_provider(rpc_url).await?; Ok(Self { @@ -155,7 +154,11 @@ impl Actor for CiphernodeRegistrySolReader { pub struct CiphernodeRegistrySol; impl CiphernodeRegistrySol { - pub async fn attach(bus: Addr, rpc_url: &str, contract_address: Address) -> Result<()> { + pub async fn attach( + bus: Addr, + rpc_url: &str, + contract_address: Address, + ) -> Result<()> { CiphernodeRegistrySolReader::attach(bus.clone(), rpc_url, contract_address).await?; Ok(()) } diff --git a/packages/ciphernode/evm/src/enclave_sol_reader.rs b/packages/ciphernode/evm/src/enclave_sol_reader.rs index a4af6d58..8424fbd6 100644 --- a/packages/ciphernode/evm/src/enclave_sol_reader.rs +++ b/packages/ciphernode/evm/src/enclave_sol_reader.rs @@ -1,4 +1,3 @@ - use crate::helpers::{self, create_readonly_provider, ReadonlyProvider}; use actix::prelude::*; use actix::{Addr, Recipient}; diff --git a/packages/ciphernode/evm/src/helpers.rs b/packages/ciphernode/evm/src/helpers.rs index f7b8d53e..a5b8da01 100644 --- a/packages/ciphernode/evm/src/helpers.rs +++ b/packages/ciphernode/evm/src/helpers.rs @@ -13,7 +13,7 @@ use alloy::{ transports::BoxTransport, }; use anyhow::{Context, Result}; -use enclave_core::{EnclaveErrorType, EnclaveEvent, BusError}; +use enclave_core::{BusError, EnclaveErrorType, EnclaveEvent}; use futures_util::stream::StreamExt; pub async fn stream_from_evm( diff --git a/packages/ciphernode/evm/src/lib.rs b/packages/ciphernode/evm/src/lib.rs index 695434ef..f244b18a 100644 --- a/packages/ciphernode/evm/src/lib.rs +++ b/packages/ciphernode/evm/src/lib.rs @@ -1,12 +1,12 @@ -mod enclave_sol; mod ciphernode_registry_sol; -mod registry_filter_sol; -pub mod helpers; +mod enclave_sol; mod enclave_sol_reader; mod enclave_sol_writer; +pub mod helpers; +mod registry_filter_sol; +pub use ciphernode_registry_sol::*; pub use enclave_sol::*; pub use enclave_sol_reader::*; pub use enclave_sol_writer::*; -pub use ciphernode_registry_sol::*; pub use registry_filter_sol::*; diff --git a/packages/ciphernode/evm/src/registry_filter_sol.rs b/packages/ciphernode/evm/src/registry_filter_sol.rs index b8a65240..4274e7ca 100644 --- a/packages/ciphernode/evm/src/registry_filter_sol.rs +++ b/packages/ciphernode/evm/src/registry_filter_sol.rs @@ -115,7 +115,11 @@ pub async fn publish_committee( pub struct RegistryFilterSol; impl RegistryFilterSol { - pub async fn attach(bus: Addr, rpc_url: &str, contract_address: Address) -> Result<()> { + pub async fn attach( + bus: Addr, + rpc_url: &str, + contract_address: Address, + ) -> Result<()> { RegistryFilterSolWriter::attach(bus.clone(), rpc_url, contract_address).await?; Ok(()) } diff --git a/packages/ciphernode/tests/tests/test_aggregation_and_decryption.rs b/packages/ciphernode/tests/tests/test_aggregation_and_decryption.rs index f8ca939c..81725a9c 100644 --- a/packages/ciphernode/tests/tests/test_aggregation_and_decryption.rs +++ b/packages/ciphernode/tests/tests/test_aggregation_and_decryption.rs @@ -1,6 +1,8 @@ use data::Data; use enclave_core::{ - CiphernodeAdded, CiphernodeSelected, CiphertextOutputPublished, DecryptionshareCreated, E3Requested, E3id, EnclaveEvent, EventBus, GetHistory, KeyshareCreated, OrderedSet, PlaintextAggregated, PublicKeyAggregated, ResetHistory, Seed + CiphernodeAdded, CiphernodeSelected, CiphertextOutputPublished, DecryptionshareCreated, + E3Requested, E3id, EnclaveEvent, EventBus, GetHistory, KeyshareCreated, OrderedSet, + PlaintextAggregated, PublicKeyAggregated, ResetHistory, Seed, }; use fhe::{setup_crp_params, ParamsWithCrp, SharedRng}; use logger::SimpleLogger;