From cdd44b7ae6710bf57b5829a935e9619f8dd5fb3a Mon Sep 17 00:00:00 2001 From: Pravdyvy Date: Wed, 18 Feb 2026 11:39:05 +0200 Subject: [PATCH] fix: fmt --- bedrock_client/src/lib.rs | 4 +--- indexer/core/src/lib.rs | 46 ++++++++++++++++++++++----------------- 2 files changed, 27 insertions(+), 23 deletions(-) diff --git a/bedrock_client/src/lib.rs b/bedrock_client/src/lib.rs index 28d62aca..7aae7783 100644 --- a/bedrock_client/src/lib.rs +++ b/bedrock_client/src/lib.rs @@ -83,9 +83,7 @@ impl BedrockClient { .await } - pub async fn get_consensus_info( - &self, - ) -> Result { + pub async fn get_consensus_info(&self) -> Result { Retry::spawn(self.backoff_strategy(), || { self.http_client .consensus_info(self.node_url.clone()) diff --git a/indexer/core/src/lib.rs b/indexer/core/src/lib.rs index fd05f372..ffde9a0b 100644 --- a/indexer/core/src/lib.rs +++ b/indexer/core/src/lib.rs @@ -162,14 +162,14 @@ impl IndexerCore { async fn get_next_tip(&self, prev_tip: HeaderId) -> Result { loop { - let next_tip = self.get_tip().await?; - if next_tip != prev_tip { - break Ok(next_tip); - } else { - info!("Wait 10s to not spam the node"); - tokio::time::sleep(std::time::Duration::from_secs(10)).await; - } + let next_tip = self.get_tip().await?; + if next_tip != prev_tip { + break Ok(next_tip); + } else { + info!("Wait 10s to not spam the node"); + tokio::time::sleep(std::time::Duration::from_secs(10)).await; } + } } /// WARNING: depending on chain behaviour, @@ -191,19 +191,25 @@ impl IndexerCore { let mut cycle_header = curr_last_header; loop { - let curr_last_block = if let Some(block) = self - .bedrock_client - .get_block_by_id(cycle_header) - .await? - { - block - } else { - break; - }; + let curr_last_block = + if let Some(block) = self.bedrock_client.get_block_by_id(cycle_header).await? { + block + } else { + break; + }; - info!("INITIAL_SEARCH: Observed L1 block at slot {}", curr_last_block.header().slot().into_inner()); - info!("INITIAL_SEARCH: This block header is {}", curr_last_block.header().id()); - info!("INITIAL_SEARCH: This block parent is {}", curr_last_block.header().parent()); + info!( + "INITIAL_SEARCH: Observed L1 block at slot {}", + curr_last_block.header().slot().into_inner() + ); + info!( + "INITIAL_SEARCH: This block header is {}", + curr_last_block.header().id() + ); + info!( + "INITIAL_SEARCH: This block parent is {}", + curr_last_block.header().parent() + ); block_buffer.push_front(curr_last_block.clone()); @@ -256,7 +262,7 @@ impl IndexerCore { curr_last_header = loop { let next_tip = self.get_tip().await?; if next_tip != curr_last_header { - break next_tip; + break next_tip; } else { info!("Wait 10s to not spam the node"); tokio::time::sleep(std::time::Duration::from_secs(10)).await;