Update serai-ethereum-processor to compile

This commit is contained in:
Luke Parker
2024-10-30 21:48:40 -04:00
parent 8e800885fb
commit b2ec58a445
7 changed files with 27 additions and 68 deletions

View File

@@ -8,10 +8,9 @@ static ALLOCATOR: zalloc::ZeroizingAlloc<std::alloc::System> =
use std::sync::Arc;
use alloy_core::primitives::U256;
use alloy_simple_request_transport::SimpleRequest;
use alloy_rpc_client::ClientBuilder;
use alloy_provider::{Provider, RootProvider};
use alloy_provider::RootProvider;
use serai_client::validator_sets::primitives::Session;
@@ -63,20 +62,10 @@ async fn main() {
ClientBuilder::default().transport(SimpleRequest::new(bin::url()), true),
));
let chain_id = loop {
match provider.get_chain_id().await {
Ok(chain_id) => break U256::try_from(chain_id).unwrap(),
Err(e) => {
log::error!("couldn't connect to the Ethereum node for the chain ID: {e:?}");
tokio::time::sleep(core::time::Duration::from_secs(5)).await;
}
}
};
bin::main_loop::<SetInitialKey, _, KeyGenParams, _>(
db.clone(),
Rpc { db: db.clone(), provider: provider.clone() },
Scheduler::<bin::Db>::new(SmartContract { chain_id }),
Scheduler::<bin::Db>::new(SmartContract),
TransactionPublisher::new(db, provider, {
let relayer_hostname = env::var("ETHEREUM_RELAYER_HOSTNAME")
.expect("ethereum relayer hostname wasn't specified")