web3-proxy/web3_proxy/src/rpcs/synced_connections.rs

17 lines
538 B
Rust
Raw Normal View History

2022-08-24 02:13:56 +03:00
use super::Web3Connection;
use ethers::prelude::{H256, U64};
use indexmap::IndexSet;
use serde::Serialize;
use std::sync::Arc;
/// A collection of Web3Connections that are on the same block.
/// Serialize is so we can print it on our debug endpoint
#[derive(Clone, Default, Serialize)]
pub struct SyncedConnections {
pub(super) head_block_num: U64,
pub(super) head_block_hash: H256,
// TODO: this should be able to serialize, but it isn't
#[serde(skip_serializing)]
pub(super) conns: IndexSet<Arc<Web3Connection>>,
}