mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-09 15:28:01 -05:00
chore: clippy happy (#18310)
This commit is contained in:
@@ -118,7 +118,7 @@ mod tests {
|
||||
];
|
||||
|
||||
for case in cases {
|
||||
let receipts = vec![
|
||||
let receipts = [
|
||||
// 0xb0d6ee650637911394396d81172bd1c637d568ed1fbddab0daddfca399c58b53
|
||||
OpReceipt::Deposit(OpDepositReceipt {
|
||||
inner: Receipt {
|
||||
|
||||
@@ -856,10 +856,12 @@ pub trait PayloadBuilder: Send + Sync + Clone {
|
||||
/// Tells the payload builder how to react to payload request if there's no payload available yet.
|
||||
///
|
||||
/// This situation can occur if the CL requests a payload before the first payload has been built.
|
||||
#[derive(Default)]
|
||||
pub enum MissingPayloadBehaviour<Payload> {
|
||||
/// Await the regular scheduled payload process.
|
||||
AwaitInProgress,
|
||||
/// Race the in progress payload process with an empty payload.
|
||||
#[default]
|
||||
RaceEmptyPayload,
|
||||
/// Race the in progress payload process with this job.
|
||||
RacePayload(Box<dyn FnOnce() -> Result<Payload, PayloadBuilderError> + Send>),
|
||||
@@ -877,12 +879,6 @@ impl<Payload> fmt::Debug for MissingPayloadBehaviour<Payload> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<Payload> Default for MissingPayloadBehaviour<Payload> {
|
||||
fn default() -> Self {
|
||||
Self::RaceEmptyPayload
|
||||
}
|
||||
}
|
||||
|
||||
/// Checks if the new payload is better than the current best.
|
||||
///
|
||||
/// This compares the total fees of the blocks, higher is better.
|
||||
|
||||
@@ -18,6 +18,7 @@ pub enum PruneMode {
|
||||
}
|
||||
|
||||
#[cfg(any(test, feature = "test-utils"))]
|
||||
#[allow(clippy::derivable_impls)]
|
||||
impl Default for PruneMode {
|
||||
fn default() -> Self {
|
||||
Self::Full
|
||||
|
||||
@@ -28,6 +28,14 @@ pub enum PruneSegment {
|
||||
Transactions,
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::derivable_impls)]
|
||||
impl Default for PruneSegment {
|
||||
fn default() -> Self {
|
||||
Self::SenderRecovery
|
||||
}
|
||||
}
|
||||
|
||||
impl PruneSegment {
|
||||
/// Returns minimum number of blocks to keep in the database for this segment.
|
||||
pub const fn min_blocks(&self, purpose: PrunePurpose) -> u64 {
|
||||
@@ -82,10 +90,3 @@ pub enum PruneSegmentError {
|
||||
#[error("the configuration provided for {0} is invalid")]
|
||||
Configuration(PruneSegment),
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
impl Default for PruneSegment {
|
||||
fn default() -> Self {
|
||||
Self::SenderRecovery
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,11 +2,12 @@ use bitflags::bitflags;
|
||||
use ffi::*;
|
||||
|
||||
/// MDBX sync mode
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
#[derive(Clone, Copy, Debug, Default)]
|
||||
pub enum SyncMode {
|
||||
/// Default robust and durable sync mode.
|
||||
/// Metadata is written and flushed to disk after a data is written and flushed, which
|
||||
/// guarantees the integrity of the database in the event of a crash at any time.
|
||||
#[default]
|
||||
Durable,
|
||||
|
||||
/// Don't sync the meta-page after commit.
|
||||
@@ -100,12 +101,6 @@ pub enum SyncMode {
|
||||
UtterlyNoSync,
|
||||
}
|
||||
|
||||
impl Default for SyncMode {
|
||||
fn default() -> Self {
|
||||
Self::Durable
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub enum Mode {
|
||||
ReadOnly,
|
||||
|
||||
@@ -748,7 +748,7 @@ mod tests {
|
||||
|
||||
// the independent set is the roots of each of these tx chains, these are the highest
|
||||
// nonces for each sender
|
||||
let expected_highest_nonces = vec![d[0].clone(), c[2].clone(), b[2].clone(), a[3].clone()]
|
||||
let expected_highest_nonces = [d[0].clone(), c[2].clone(), b[2].clone(), a[3].clone()]
|
||||
.iter()
|
||||
.map(|tx| (tx.sender(), tx.nonce()))
|
||||
.collect::<HashSet<_>>();
|
||||
|
||||
@@ -5687,7 +5687,7 @@ mod tests {
|
||||
// 0xXY: Leaf { key: 0xZ... }
|
||||
|
||||
// Create leaves that will force multiple subtries
|
||||
let leaves = vec![
|
||||
let leaves = [
|
||||
ctx.create_test_leaf([0x0, 0x0, 0x1, 0x2], 1),
|
||||
ctx.create_test_leaf([0x0, 0x1, 0x3, 0x4], 2),
|
||||
ctx.create_test_leaf([0x0, 0x2, 0x5, 0x6], 3),
|
||||
|
||||
Reference in New Issue
Block a user