Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
georgehao committed Jan 20, 2025
1 parent a4fea38 commit 7db94a1
Show file tree
Hide file tree
Showing 20 changed files with 40 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/chain-state/src/in_memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -827,11 +827,13 @@ impl<N: NodePrimitives> ExecutedBlock<N> {
}

/// Returns a reference to the executed block.
#[allow(clippy::missing_const_for_fn)]
pub fn block(&self) -> &SealedBlockFor<N::Block> {
&self.block
}

/// Returns a reference to the block's senders
#[allow(clippy::missing_const_for_fn)]
pub fn senders(&self) -> &Vec<Address> {
&self.senders
}
Expand All @@ -844,16 +846,19 @@ impl<N: NodePrimitives> ExecutedBlock<N> {
}

/// Returns a reference to the block's execution outcome
#[allow(clippy::missing_const_for_fn)]
pub fn execution_outcome(&self) -> &ExecutionOutcome<N::Receipt> {
&self.execution_output
}

/// Returns a reference to the hashed state result of the execution outcome
#[allow(clippy::missing_const_for_fn)]
pub fn hashed_state(&self) -> &HashedPostState {
&self.hashed_state
}

/// Returns a reference to the trie updates for the block
#[allow(clippy::missing_const_for_fn)]
pub fn trie_updates(&self) -> &TrieUpdates {
&self.trie
}
Expand Down
1 change: 1 addition & 0 deletions crates/ethereum/engine-primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ impl EthereumEngineValidator {

/// Returns the chain spec used by the validator.
#[inline]
#[allow(clippy::missing_const_for_fn)]
fn chain_spec(&self) -> &ChainSpec {
self.inner.chain_spec()
}
Expand Down
2 changes: 2 additions & 0 deletions crates/ethereum/engine-primitives/src/payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ impl EthBuiltPayload {
}

/// Returns the built block(sealed)
#[allow(clippy::missing_const_for_fn)]
pub fn block(&self) -> &SealedBlock {
&self.block
}
Expand All @@ -69,6 +70,7 @@ impl EthBuiltPayload {
}

/// Returns the blob sidecars.
#[allow(clippy::missing_const_for_fn)]
pub fn sidecars(&self) -> &[BlobTransactionSidecar] {
&self.sidecars
}
Expand Down
1 change: 1 addition & 0 deletions crates/net/eth-wire-types/src/capability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ pub struct Capabilities {
impl Capabilities {
/// Returns all capabilities.
#[inline]
#[allow(clippy::missing_const_for_fn)]
pub fn capabilities(&self) -> &[Capability] {
&self.inner
}
Expand Down
5 changes: 5 additions & 0 deletions crates/net/network/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,18 @@ impl<N: NetworkPrimitives> NetworkHandle<N> {
}

/// Returns the [`PeerId`] used in the network.
#[allow(clippy::missing_const_for_fn)]
pub fn peer_id(&self) -> &PeerId {
&self.inner.local_peer_id
}

#[allow(clippy::missing_const_for_fn)]
fn manager(&self) -> &UnboundedSender<NetworkHandleMessage<N>> {
&self.inner.to_manager_tx
}

/// Returns the mode of the network, either pow, or pos
#[allow(clippy::missing_const_for_fn)]
pub fn mode(&self) -> &NetworkMode {
&self.inner.network_mode
}
Expand Down Expand Up @@ -182,11 +185,13 @@ impl<N: NetworkPrimitives> NetworkHandle<N> {
}

/// Whether tx gossip is disabled
#[allow(clippy::missing_const_for_fn)]
pub fn tx_gossip_disabled(&self) -> bool {
self.inner.tx_gossip_disabled
}

/// Returns the secret key used for authenticating sessions.
#[allow(clippy::missing_const_for_fn)]
pub fn secret_key(&self) -> &SecretKey {
&self.inner.secret_key
}
Expand Down
2 changes: 2 additions & 0 deletions crates/net/network/src/test_utils/testnet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ where
}

/// Return a slice of all peers.
#[allow(clippy::missing_const_for_fn)]
pub fn peers(&self) -> &[Peer<C, Pool>] {
&self.peers
}
Expand Down Expand Up @@ -331,6 +332,7 @@ impl<C, Pool> TestnetHandle<C, Pool> {
}

/// Returns the [`PeerHandle`]s of this [`Testnet`].
#[allow(clippy::missing_const_for_fn)]
pub fn peers(&self) -> &[PeerHandle<Pool>] {
&self.peers
}
Expand Down
1 change: 1 addition & 0 deletions crates/revm/src/batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ impl<T> BlockBatchRecord<T> {
}

/// Returns the recorded requests.
#[allow(clippy::missing_const_for_fn)]
pub fn requests(&self) -> &[Requests] {
&self.requests
}
Expand Down
1 change: 1 addition & 0 deletions crates/rpc/rpc-eth-types/src/fee_history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ impl FeeHistoryCache {

/// How the cache is configured.
#[inline]
#[allow(clippy::missing_const_for_fn)]
pub fn config(&self) -> &FeeHistoryCacheConfig {
&self.inner.config
}
Expand Down
1 change: 1 addition & 0 deletions crates/storage/db/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ pub mod test_utils {
}

/// Returns the path to the database.
#[allow(clippy::missing_const_for_fn)]
pub fn path(&self) -> &Path {
&self.path
}
Expand Down
1 change: 1 addition & 0 deletions crates/storage/db/src/tables/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ impl<V: Value> RawValue<V> {
}

/// Returns the raw value as seen on the database.
#[allow(clippy::missing_const_for_fn)]
pub fn raw_value(&self) -> &[u8] {
&self.value
}
Expand Down
4 changes: 4 additions & 0 deletions crates/storage/libmdbx-rs/src/environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,14 @@ impl Environment {

/// Returns true if the environment was opened as WRITEMAP.
#[inline]
#[allow(clippy::missing_const_for_fn)]
pub fn is_write_map(&self) -> bool {
self.inner.env_kind.is_write_map()
}

/// Returns the kind of the environment.
#[inline]
#[allow(clippy::missing_const_for_fn)]
pub fn env_kind(&self) -> EnvironmentKind {
self.inner.env_kind
}
Expand All @@ -84,6 +86,7 @@ impl Environment {

/// Returns the transaction manager.
#[inline]
#[allow(clippy::missing_const_for_fn)]
pub(crate) fn txn_manager(&self) -> &TxnManager {
&self.inner.txn_manager
}
Expand Down Expand Up @@ -131,6 +134,7 @@ impl Environment {
/// The caller **must** ensure that the pointer is never dereferenced after the environment has
/// been dropped.
#[inline]
#[allow(clippy::missing_const_for_fn)]
pub(crate) fn env_ptr(&self) -> *mut ffi::MDBX_env {
self.inner.env
}
Expand Down
2 changes: 2 additions & 0 deletions crates/storage/libmdbx-rs/src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,13 @@ where
/// Returns a copy of the raw pointer to the underlying MDBX transaction.
#[doc(hidden)]
#[cfg(test)]
#[allow(clippy::missing_const_for_fn)]
pub fn txn(&self) -> *mut ffi::MDBX_txn {
self.inner.txn.txn
}

/// Returns a raw pointer to the MDBX environment.
#[allow(clippy::missing_const_for_fn)]
pub fn env(&self) -> &Environment {
&self.inner.env
}
Expand Down
1 change: 1 addition & 0 deletions crates/storage/nippy-jar/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ impl DataReader {
}

/// Returns total size of data
#[allow(clippy::missing_const_for_fn)]
pub fn size(&self) -> usize {
self.data_mmap.len()
}
Expand Down
1 change: 1 addition & 0 deletions crates/storage/nippy-jar/src/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ impl<H: NippyJarHeader> NippyJarWriter<H> {

/// Returns a reference to the offsets vector.
#[cfg(test)]
#[allow(clippy::missing_const_for_fn)]
pub fn offsets(&self) -> &[u64] {
&self.offsets
}
Expand Down
1 change: 1 addition & 0 deletions crates/storage/provider/src/providers/database/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,7 @@ impl<TX: DbTx + 'static, N: NodeTypesForProvider> DatabaseProvider<TX, N> {
}

/// Returns a reference to the chain specification.
#[allow(clippy::missing_const_for_fn)]
pub fn chain_spec(&self) -> &N::ChainSpec {
&self.chain_spec
}
Expand Down
3 changes: 3 additions & 0 deletions crates/storage/provider/src/providers/static_file/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1073,6 +1073,7 @@ impl<N: NodePrimitives> StaticFileProvider<N> {
}

/// Returns directory where `static_files` are located.
#[allow(clippy::missing_const_for_fn)]
pub fn directory(&self) -> &Path {
&self.path
}
Expand Down Expand Up @@ -1166,12 +1167,14 @@ impl<N: NodePrimitives> StaticFileProvider<N> {

/// Returns `static_files` directory
#[cfg(any(test, feature = "test-utils"))]
#[allow(clippy::missing_const_for_fn)]
pub fn path(&self) -> &Path {
&self.path
}

/// Returns `static_files` transaction index
#[cfg(any(test, feature = "test-utils"))]
#[allow(clippy::missing_const_for_fn)]
pub fn tx_index(&self) -> &RwLock<SegmentRanges> {
&self.static_files_tx_index
}
Expand Down
1 change: 1 addition & 0 deletions crates/transaction-pool/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ where
}

/// Returns the wrapped pool.
#[allow(clippy::missing_const_for_fn)]
pub(crate) fn inner(&self) -> &PoolInner<V, T, S> {
&self.pool
}
Expand Down
3 changes: 3 additions & 0 deletions crates/transaction-pool/src/pool/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1078,6 +1078,7 @@ impl<T: PoolTransaction> AddedPendingTransaction<T> {
}

/// Returns if the transaction should be propagated.
#[allow(clippy::missing_const_for_fn)]
pub(crate) fn is_propagate_allowed(&self) -> bool {
self.transaction.propagate
}
Expand Down Expand Up @@ -1168,6 +1169,7 @@ impl<T: PoolTransaction> AddedTransaction<T> {
}

/// Returns the discarded transactions if there were any
#[allow(clippy::missing_const_for_fn)]
pub(crate) fn discarded_transactions(&self) -> Option<&[Arc<ValidPoolTransaction<T>>]> {
match self {
Self::Pending(tx) => Some(&tx.discarded),
Expand Down Expand Up @@ -1211,6 +1213,7 @@ impl<T: PoolTransaction> AddedTransaction<T> {

/// Returns the [`TransactionId`] of the added transaction
#[cfg(test)]
#[allow(clippy::missing_const_for_fn)]
pub(crate) fn id(&self) -> &TransactionId {
match self {
Self::Pending(added) => added.transaction.id(),
Expand Down
1 change: 1 addition & 0 deletions crates/transaction-pool/src/pool/pending.rs
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,7 @@ pub(crate) struct PendingTransaction<T: TransactionOrdering> {

impl<T: TransactionOrdering> PendingTransaction<T> {
/// The next transaction of the sender: `nonce + 1`
#[allow(clippy::missing_const_for_fn)]
pub(crate) fn unlocks(&self) -> TransactionId {
self.transaction.transaction_id.descendant()
}
Expand Down
3 changes: 3 additions & 0 deletions crates/transaction-pool/src/validate/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@ pub struct EthTransactionValidator<Client, T> {

impl<Client, Tx> EthTransactionValidator<Client, Tx> {
/// Returns the configured chain spec
#[allow(clippy::missing_const_for_fn)]
pub fn chain_spec(&self) -> &Arc<ChainSpec> {
&self.inner.chain_spec
}

/// Returns the configured client
#[allow(clippy::missing_const_for_fn)]
pub fn client(&self) -> &Client {
&self.inner.client
}
Expand Down Expand Up @@ -165,6 +167,7 @@ pub(crate) struct EthTransactionValidatorInner<Client, T> {

impl<Client, Tx> EthTransactionValidatorInner<Client, Tx> {
/// Returns the configured chain id
#[allow(clippy::missing_const_for_fn)]
pub(crate) fn chain_id(&self) -> u64 {
self.chain_spec.chain().id()
}
Expand Down

0 comments on commit 7db94a1

Please sign in to comment.