Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ryardley committed Oct 31, 2024
1 parent 9977a69 commit edea81f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
12 changes: 10 additions & 2 deletions packages/ciphernode/enclave_node/src/aggregator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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?;
Expand Down
8 changes: 6 additions & 2 deletions packages/ciphernode/enclave_node/src/ciphernode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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())
Expand Down
6 changes: 5 additions & 1 deletion packages/ciphernode/evm/src/ciphernode_registry_sol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@ impl CiphernodeRegistrySolReader {

pub struct CiphernodeRegistrySol;
impl CiphernodeRegistrySol {
pub async fn attach(bus: &Addr<EventBus>, provider: &ReadonlyProvider, contract_address: &str) -> Result<()> {
pub async fn attach(
bus: &Addr<EventBus>,
provider: &ReadonlyProvider,
contract_address: &str,
) -> Result<()> {
CiphernodeRegistrySolReader::attach(bus, provider, contract_address).await?;
Ok(())
}
Expand Down
1 change: 0 additions & 1 deletion packages/ciphernode/evm/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ pub async fn stream_from_evm<P: Provider>(
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)]
Expand Down

0 comments on commit edea81f

Please sign in to comment.