From bfd61094eefeec8c3b41ef81680bf6dbc36162f3 Mon Sep 17 00:00:00 2001 From: sprites0 <199826320+sprites0@users.noreply.github.com> Date: Sun, 5 Oct 2025 09:57:36 +0000 Subject: [PATCH] chore: cargo fmt --- src/addons/hl_node_compliance.rs | 2 +- src/node/rpc/estimate.rs | 20 +++++++++++--------- src/pseudo_peer/service.rs | 9 +++++---- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/addons/hl_node_compliance.rs b/src/addons/hl_node_compliance.rs index 9c6169985..0c2f68142 100644 --- a/src/addons/hl_node_compliance.rs +++ b/src/addons/hl_node_compliance.rs @@ -579,7 +579,7 @@ async fn adjust_transaction_receipt( fn system_tx_count_for_block(eth_api: &Eth, block_id: BlockId) -> usize { let provider = eth_api.provider(); let block = provider.block_by_id(block_id).unwrap().unwrap(); - + block.body.transactions().iter().filter(|tx| tx.is_system_transaction()).count() } diff --git a/src/node/rpc/estimate.rs b/src/node/rpc/estimate.rs index 392deb08a..fae7c8772 100644 --- a/src/node/rpc/estimate.rs +++ b/src/node/rpc/estimate.rs @@ -82,11 +82,12 @@ where let mut tx_env = self.create_txn_env(&evm_env, request, &mut db)?; let mut is_basic_transfer = false; - if tx_env.input().is_empty() - && let TxKind::Call(to) = tx_env.kind() - && let Ok(code) = db.db.account_code(&to) { - is_basic_transfer = code.map(|code| code.is_empty()).unwrap_or(true); - } + if tx_env.input().is_empty() && + let TxKind::Call(to) = tx_env.kind() && + let Ok(code) = db.db.account_code(&to) + { + is_basic_transfer = code.map(|code| code.is_empty()).unwrap_or(true); + } if tx_env.gas_price() > 0 { highest_gas_limit = @@ -105,10 +106,11 @@ where let mut min_tx_env = tx_env.clone(); min_tx_env.set_gas_limit(MIN_TRANSACTION_GAS); - if let Ok(res) = evm.transact(min_tx_env).map_err(Self::Error::from_evm_err) - && res.result.is_success() { - return Ok(U256::from(MIN_TRANSACTION_GAS)); - } + if let Ok(res) = evm.transact(min_tx_env).map_err(Self::Error::from_evm_err) && + res.result.is_success() + { + return Ok(U256::from(MIN_TRANSACTION_GAS)); + } } trace!(target: "rpc::eth::estimate", ?tx_env, gas_limit = tx_env.gas_limit(), is_basic_transfer, "Starting gas estimation"); diff --git a/src/pseudo_peer/service.rs b/src/pseudo_peer/service.rs index 4d4c74397..d0324b6e7 100644 --- a/src/pseudo_peer/service.rs +++ b/src/pseudo_peer/service.rs @@ -81,10 +81,11 @@ impl BlockPoller { .await .ok_or(eyre::eyre!("Failed to find latest block number"))?; - if let Some(debug_cutoff_height) = debug_cutoff_height - && next_block_number > debug_cutoff_height { - next_block_number = debug_cutoff_height; - } + if let Some(debug_cutoff_height) = debug_cutoff_height && + next_block_number > debug_cutoff_height + { + next_block_number = debug_cutoff_height; + } loop { match block_source.collect_block(next_block_number).await {