Skip to content
This repository was archived by the owner on Jan 8, 2025. It is now read-only.

Commit

Permalink
clippy: rm unused clippy allowances (#1471)
Browse files Browse the repository at this point in the history
  • Loading branch information
tcoratger authored Oct 20, 2024
1 parent 3b713ff commit ead6737
Show file tree
Hide file tree
Showing 10 changed files with 3 additions and 15 deletions.
2 changes: 0 additions & 2 deletions src/eth_rpc/servers/alchemy_rpc.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![allow(clippy::blocks_in_conditions)]

use crate::{
eth_rpc::api::alchemy_api::AlchemyApiServer,
models::token::{TokenBalances, TokenMetadata},
Expand Down
1 change: 0 additions & 1 deletion src/eth_rpc/servers/debug_rpc.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![allow(clippy::blocks_in_conditions)]
use crate::{eth_rpc::api::debug_api::DebugApiServer, providers::debug_provider::DebugProvider};
use alloy_primitives::{Bytes, B256};
use alloy_rpc_types::{BlockId, BlockNumberOrTag, TransactionRequest};
Expand Down
2 changes: 0 additions & 2 deletions src/eth_rpc/servers/eth_rpc.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![allow(clippy::blocks_in_conditions)]

use crate::{
client::{EthClient, KakarotTransactions, TransactionHashProvider},
eth_rpc::api::eth_api::EthApiServer,
Expand Down
1 change: 0 additions & 1 deletion src/eth_rpc/servers/trace_rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ impl<P: EthereumProvider> TraceRpc<P> {
#[async_trait]
impl<P: EthereumProvider + Send + Sync + 'static> TraceApiServer for TraceRpc<P> {
/// Returns the parity traces for the given block.
#[allow(clippy::blocks_in_conditions)]
#[tracing::instrument(skip(self), err)]
async fn trace_block(&self, block_id: BlockId) -> Result<Option<Vec<LocalizedTransactionTrace>>> {
tracing::info!("Serving debug_traceBlock");
Expand Down
1 change: 0 additions & 1 deletion src/models/felt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ impl From<Felt252Wrapper> for Felt {
}
}

#[allow(clippy::fallible_impl_from)]
impl From<Address> for Felt252Wrapper {
fn from(address: Address) -> Self {
Self(Felt::from_bytes_be_slice(address.as_slice()))
Expand Down
1 change: 0 additions & 1 deletion src/providers/eth_provider/database/ethereum.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![allow(clippy::blocks_in_conditions)]
use super::{
filter,
filter::EthDatabaseFilterBuilder,
Expand Down
1 change: 0 additions & 1 deletion src/providers/eth_provider/database/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ pub struct EthCacheDatabase<P: EthereumProvider + Send + Sync>(pub CacheDB<EthDa

/// Ethereum database type.
#[derive(Debug, Clone)]
#[allow(clippy::redundant_pub_crate)]
pub struct EthDatabase<P: EthereumProvider + Send + Sync> {
/// The Ethereum provider.
provider: P,
Expand Down
7 changes: 3 additions & 4 deletions src/test_utils/katana/genesis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ impl KatanaGenesisBuilder<Loaded> {
impl KatanaGenesisBuilder<Initialized> {
/// Add an EOA to the genesis. The EOA is deployed to the address derived from the given private key.
pub fn with_eoa(mut self, private_key: B256) -> Result<Self> {
let evm_address = self.evm_address(private_key)?;
let evm_address = Self::evm_address(private_key)?;

let kakarot_address = self.cache_load("kakarot_address")?;
let account_contract_class_hash = self.account_contract_class_hash()?;
Expand Down Expand Up @@ -295,7 +295,7 @@ impl KatanaGenesisBuilder<Initialized> {
/// Fund the starknet address deployed for the evm address of the passed private key
/// with the given amount of tokens.
pub fn fund(mut self, pk: B256, amount: U256) -> Result<Self> {
let evm_address = self.evm_address(pk)?;
let evm_address = Self::evm_address(pk)?;
let starknet_address = self.compute_starknet_address(evm_address)?;
let eoa = self.contracts.get_mut(&starknet_address).ok_or_eyre("Missing EOA contract")?;

Expand Down Expand Up @@ -349,8 +349,7 @@ impl KatanaGenesisBuilder<Initialized> {
)))
}

#[allow(clippy::unused_self)]
fn evm_address(&self, pk: B256) -> Result<Felt> {
fn evm_address(pk: B256) -> Result<Felt> {
Ok(Felt::from_bytes_be_slice(&PrivateKeySigner::from_bytes(&pk)?.address().into_array()))
}

Expand Down
1 change: 0 additions & 1 deletion src/test_utils/katana/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ impl<'a> Katana {
&self.eoa
}

#[allow(dead_code)]
pub const fn sequencer(&self) -> &TestSequencer {
&self.sequencer
}
Expand Down
1 change: 0 additions & 1 deletion src/test_utils/rpc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ use std::net::SocketAddr;
///
/// `allow(dead_code)` is used because this function is used in tests,
/// and each test is compiled separately, so the compiler thinks this function is unused
#[allow(dead_code)]
pub async fn start_kakarot_rpc_server(katana: &Katana) -> Result<(SocketAddr, ServerHandle), eyre::Report> {
let eth_client = katana.eth_client();
Ok(run_server(
Expand Down

0 comments on commit ead6737

Please sign in to comment.