From 4136d9d50a7a2dfaf04324384a9ed35f051355ec Mon Sep 17 00:00:00 2001 From: sprites0 <199826320+sprites0@users.noreply.github.com> Date: Tue, 1 Jul 2025 02:19:32 +0000 Subject: [PATCH] chore: more clippy fixes --- src/node/types/reth_compat.rs | 2 +- src/pseudo_peer/mod.rs | 2 +- src/pseudo_peer/service.rs | 16 ++++++++-------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/node/types/reth_compat.rs b/src/node/types/reth_compat.rs index faa5a67f0..9c527783d 100644 --- a/src/node/types/reth_compat.rs +++ b/src/node/types/reth_compat.rs @@ -99,7 +99,7 @@ fn system_tx_to_reth_transaction(transaction: &SystemTx, chain_id: u64) -> TxSig break spot.to_s(); } - info!("Contract not found: {:?} from spot mapping, fetching again...", to); + info!("Contract not found: {to:?} from spot mapping, fetching again..."); *EVM_MAP.write().unwrap() = erc20_contract_to_spot_token(chain_id).unwrap(); } }; diff --git a/src/pseudo_peer/mod.rs b/src/pseudo_peer/mod.rs index a1b80283c..ac84b6690 100644 --- a/src/pseudo_peer/mod.rs +++ b/src/pseudo_peer/mod.rs @@ -71,7 +71,7 @@ pub async fn start_pseudo_peer( loop { tokio::select! { Some(event) = tokio_stream::StreamExt::next(&mut network_events) => { - info!("Network event: {:?}", event); + info!("Network event: {event:?}"); if matches!(event, NetworkEvent::ActivePeerSession { .. }) && first { start_tx.send(()).await?; first = false; diff --git a/src/pseudo_peer/service.rs b/src/pseudo_peer/service.rs index 29fc9b999..23902827b 100644 --- a/src/pseudo_peer/service.rs +++ b/src/pseudo_peer/service.rs @@ -204,10 +204,10 @@ impl PseudoPeer { let _ = response.send(Ok(BlockBodies(block_bodies))); } IncomingEthRequest::GetNodeData { .. } => { - debug!("GetNodeData request: {:?}", eth_req); + debug!("GetNodeData request: {eth_req:?}"); } eth_req => { - debug!("New eth protocol request: {:?}", eth_req); + debug!("New eth protocol request: {eth_req:?}"); } } Ok(()) @@ -232,7 +232,7 @@ impl PseudoPeer { } } - panic!("Hash not found: {:?}", hash); + panic!("Hash not found: {hash:?}"); } async fn fallback_to_official_rpc(&self, hash: B256) -> eyre::Result { @@ -243,7 +243,7 @@ impl PseudoPeer { use jsonrpsee::http_client::HttpClientBuilder; use jsonrpsee_core::client::ClientT; - debug!("Fallback to official RPC: {:?}", hash); + debug!("Fallback to official RPC: {hash:?}"); let client = HttpClientBuilder::default().build("https://rpc.hyperliquid.xyz/evm").unwrap(); let target_block: Block = client.request("eth_getBlockByHash", (hash, false)).await?; @@ -271,7 +271,7 @@ impl PseudoPeer { latest: u64, ) -> eyre::Result> { let chunk_size = self.block_source.recommended_chunk_size(); - debug!("Hash not found, backfilling... {:?}", target_hash); + debug!("Hash not found, backfilling... {target_hash:?}"); const TRY_OFFICIAL_RPC_THRESHOLD: usize = 20; for (iteration, end) in (1..=latest).rev().step_by(chunk_size as usize).enumerate() { @@ -293,13 +293,13 @@ impl PseudoPeer { return Ok(Some(block_number)); } Err(e) => { - debug!("Fallback to official RPC failed: {:?}", e); + debug!("Fallback to official RPC failed: {e:?}"); } } } } - debug!("Hash not found: {:?}, retrying from the latest block...", target_hash); + debug!("Hash not found: {target_hash:?}, retrying from the latest block..."); Ok(None) // Not found } @@ -334,7 +334,7 @@ impl PseudoPeer { return Ok(None); } - debug!("Backfilling from {} to {}", start_number, end_number); + debug!("Backfilling from {start_number} to {end_number}"); // Collect blocks and cache them let blocks = self.collect_blocks(uncached_block_numbers).await;