chore: clippy

This commit is contained in:
sprites0
2025-07-04 23:22:09 +00:00
parent dba4557140
commit c31b0c4b8a
3 changed files with 6 additions and 14 deletions

View File

@ -147,7 +147,7 @@ impl<Eth: EthWrapper> EthFilterApiServer<RpcTransaction<Eth::NetworkTypes>>
transactions
.iter()
.filter(|tx| tx.is_system_transaction())
.map(|tx| tx.tx_hash().clone())
.map(|tx| *tx.tx_hash())
.collect::<Vec<_>>()
})
.collect();
@ -216,12 +216,10 @@ impl<Eth: EthWrapper> EthPubSubApiServer<RpcTransaction<Eth::NetworkTypes>>
fn not_from_system_tx<Eth: EthWrapper>(log: &Log, provider: &Eth::Provider) -> bool {
let block = provider.block_by_number(log.block_number.unwrap()).unwrap().unwrap();
let transactions = block.body.transactions().collect::<Vec<_>>();
transactions
!transactions
.iter()
.filter(|tx| tx.is_system_transaction())
.map(|tx| tx.tx_hash().clone())
.find(|tx_hash| tx_hash == &log.transaction_hash.unwrap())
.is_none()
.map(|tx| *tx.tx_hash()).any(|tx_hash| tx_hash == log.transaction_hash.unwrap())
}
/// Helper to convert a serde error into an [`ErrorObject`]

View File

@ -145,7 +145,7 @@ where
if let Some(recovered_block) = recovered_block {
let recovered_block = if hl_node_compliant {
filter_if_hl_node_compliant(&*recovered_block)
filter_if_hl_node_compliant(&recovered_block)
} else {
(*recovered_block).clone()
};
@ -167,7 +167,7 @@ fn filter_if_hl_node_compliant(
.position(|tx| !tx.is_system_transaction())
.unwrap_or(transactions.len());
let mut new_block: HlBlock = sealed_block.clone_block().into();
let mut new_block: HlBlock = sealed_block.clone_block();
new_block.body.transactions.drain(..to_skip);
let new_sealed_block = SealedBlock::new_unchecked(new_block, sealed_block.hash());
let new_senders = recovered_block.senders()[to_skip..].to_vec();

View File

@ -258,19 +258,13 @@ where
}
/// Builds [`HlEthApi`] for HL.
#[derive(Debug)]
#[derive(Debug, Default)]
#[non_exhaustive]
pub struct HlEthApiBuilder {
/// Whether the node is in HL node compliant mode.
pub(crate) hl_node_compliant: bool,
}
impl Default for HlEthApiBuilder {
fn default() -> Self {
Self { hl_node_compliant: false }
}
}
impl<N> EthApiBuilder<N> for HlEthApiBuilder
where
N: FullNodeComponents,