mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
Solve some clippy stuffs (#6247)
This commit is contained in:
@ -1,4 +1,13 @@
|
||||
#![allow(missing_docs)]
|
||||
//! # Ethereum MAC Module
|
||||
//!
|
||||
//! This module provides the implementation of the Ethereum MAC (Message Authentication Code)
|
||||
//! construction, as specified in the Ethereum RLPx protocol.
|
||||
//!
|
||||
//! The Ethereum MAC is a nonstandard MAC construction that utilizes AES-256 (as a block cipher)
|
||||
//! and Keccak-256. It is specifically designed for messages of 128 bits in length and is not
|
||||
//! intended for general MAC use.
|
||||
//!
|
||||
//! For more information, refer to the [Ethereum MAC specification](https://github.com/ethereum/devp2p/blob/master/rlpx.md#mac).
|
||||
|
||||
use aes::Aes256Enc;
|
||||
use block_padding::NoPadding;
|
||||
@ -9,6 +18,11 @@ use reth_primitives::{B128, B256};
|
||||
use sha3::{Digest, Keccak256};
|
||||
use typenum::U16;
|
||||
|
||||
/// Type alias for a fixed-size array of 16 bytes used as headers.
|
||||
///
|
||||
/// This type is defined as [`GenericArray<u8, U16>`] and is commonly employed in Ethereum RLPx
|
||||
/// protocol-related structures for headers. It represents 16 bytes of data used in various
|
||||
/// cryptographic operations, such as MAC (Message Authentication Code) computation.
|
||||
pub type HeaderBytes = GenericArray<u8, U16>;
|
||||
|
||||
/// [`Ethereum MAC`](https://github.com/ethereum/devp2p/blob/master/rlpx.md#mac) state.
|
||||
|
||||
@ -19,8 +19,7 @@ use std::{
|
||||
///
|
||||
/// Note: This type is generic over [ParkedPool] which enforces that the underlying transaction type
|
||||
/// is [ValidPoolTransaction] wrapped in an [Arc].
|
||||
#[allow(missing_debug_implementations)]
|
||||
#[derive(Clone)]
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct ParkedPool<T: ParkedOrd> {
|
||||
/// Keeps track of transactions inserted in the pool.
|
||||
///
|
||||
@ -296,6 +295,7 @@ impl<T: ParkedOrd> Default for ParkedPool<T> {
|
||||
}
|
||||
|
||||
/// Represents a transaction in this pool.
|
||||
#[derive(Debug)]
|
||||
struct ParkedPoolTransaction<T: ParkedOrd> {
|
||||
/// Identifier that tags when transaction was submitted in the pool.
|
||||
submission_id: u64,
|
||||
|
||||
@ -22,8 +22,7 @@ use tokio::sync::broadcast;
|
||||
///
|
||||
/// Once an `independent` transaction was executed it *unlocks* the next nonce, if this transaction
|
||||
/// is also pending, then this will be moved to the `independent` queue.
|
||||
#[allow(missing_debug_implementations)]
|
||||
#[derive(Clone)]
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct PendingPool<T: TransactionOrdering> {
|
||||
/// How to order transactions.
|
||||
ordering: T,
|
||||
@ -516,6 +515,7 @@ impl<T: TransactionOrdering> PendingPool<T> {
|
||||
}
|
||||
|
||||
/// A transaction that is ready to be included in a block.
|
||||
#[derive(Debug)]
|
||||
pub(crate) struct PendingTransaction<T: TransactionOrdering> {
|
||||
/// Identifier that tags when transaction was submitted in the pool.
|
||||
pub(crate) submission_id: u64,
|
||||
|
||||
@ -7,6 +7,7 @@ use reth_primitives::{
|
||||
};
|
||||
|
||||
/// A generator for transactions for testing purposes.
|
||||
#[derive(Debug)]
|
||||
pub struct TransactionGenerator<R> {
|
||||
/// The random number generator used for generating keys and selecting signers.
|
||||
pub rng: R,
|
||||
@ -99,6 +100,7 @@ impl<R: Rng> TransactionGenerator<R> {
|
||||
}
|
||||
|
||||
/// A Builder type to configure and create a transaction.
|
||||
#[derive(Debug)]
|
||||
pub struct TransactionBuilder {
|
||||
/// The signer used to sign the transaction.
|
||||
pub signer: B256,
|
||||
|
||||
@ -1094,7 +1094,7 @@ impl proptest::arbitrary::Arbitrary for MockTransaction {
|
||||
}
|
||||
|
||||
/// A factory for creating and managing various types of mock transactions.
|
||||
#[derive(Default)]
|
||||
#[derive(Debug, Default)]
|
||||
pub struct MockTransactionFactory {
|
||||
pub(crate) ids: SenderIdentifiers,
|
||||
}
|
||||
@ -1169,6 +1169,7 @@ impl TransactionOrdering for MockOrdering {
|
||||
}
|
||||
|
||||
/// A configured distribution that can generate transactions
|
||||
#[derive(Debug)]
|
||||
pub struct MockTransactionDistribution {
|
||||
/// legacy to EIP-1559 ration
|
||||
legacy_ratio: WeightedIndex<u32>,
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
//! Internal helpers for testing.
|
||||
|
||||
#![allow(missing_debug_implementations)]
|
||||
|
||||
use crate::{blobstore::InMemoryBlobStore, noop::MockTransactionValidator, Pool};
|
||||
|
||||
mod gen;
|
||||
|
||||
Reference in New Issue
Block a user