From 9549e19cd408abbc48847d966d8061fbc8c68694 Mon Sep 17 00:00:00 2001 From: Filipe Azevedo Date: Mon, 10 Jun 2024 10:23:21 +0100 Subject: [PATCH] code review comments --- chain/ethereum/src/ingestor.rs | 2 +- chain/ethereum/src/network.rs | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/chain/ethereum/src/ingestor.rs b/chain/ethereum/src/ingestor.rs index 1bedf26876a..d22e08c4294 100644 --- a/chain/ethereum/src/ingestor.rs +++ b/chain/ethereum/src/ingestor.rs @@ -78,7 +78,7 @@ impl PollingBlockIngestor { // To check if there is a new block or not, fetch only the block header since that's cheaper // than the full block. This is worthwhile because most of the time there won't be a new // block, as we expect the poll interval to be much shorter than the block time. - let latest_block = self.latest_block(&logger, ð_adapter).await?; + let latest_block = self.latest_block(logger, ð_adapter).await?; if let Some(head_block) = head_block_ptr_opt.as_ref() { // If latest block matches head block in store, nothing needs to be done diff --git a/chain/ethereum/src/network.rs b/chain/ethereum/src/network.rs index b2860e6b156..00b695604b3 100644 --- a/chain/ethereum/src/network.rs +++ b/chain/ethereum/src/network.rs @@ -80,6 +80,7 @@ pub struct EthereumNetworkAdapters { } impl EthereumNetworkAdapters { + #[cfg(debug_assertions)] pub fn empty() -> Self { Self { chain_id: "".into(), @@ -150,6 +151,9 @@ impl EthereumNetworkAdapters { .filter(|adapter| adapter.get_capacity() > AvailableCapacity::Unavailable) } + /// returns all the available adapters that meet the required capabilities + /// if no adapters are available at the time or none that meet the capabilities then + /// an empty iterator is returned. pub async fn all_cheapest_with( &self, required_capabilities: &NodeCapabilities, @@ -164,7 +168,7 @@ impl EthereumNetworkAdapters { } // get all the adapters, don't trigger the ProviderManager's validations because we want - // this function to remain sync + // this function to remain sync. If no adapters are available an empty iterator is returned. pub(crate) fn all_unverified_cheapest_with( &self, required_capabilities: &NodeCapabilities,