mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
refactor: remove #[reth_codec] and #[derive_arbitrary] macros (#10263)
This commit is contained in:
@ -1,12 +1,12 @@
|
||||
use crate::PruneMode;
|
||||
use alloy_primitives::{BlockNumber, TxNumber};
|
||||
use reth_codecs::{reth_codec, Compact};
|
||||
use reth_codecs::{add_arbitrary_tests, Compact};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Saves the pruning progress of a stage.
|
||||
#[reth_codec]
|
||||
#[derive(Debug, PartialEq, Eq, Clone, Copy, Serialize, Deserialize)]
|
||||
#[cfg_attr(test, derive(Default))]
|
||||
#[derive(Debug, PartialEq, Eq, Clone, Copy, Serialize, Deserialize, Compact)]
|
||||
#[cfg_attr(test, derive(Default, arbitrary::Arbitrary))]
|
||||
#[add_arbitrary_tests(compact)]
|
||||
pub struct PruneCheckpoint {
|
||||
/// Highest pruned block number. If it's [None], the pruning for block `0` is not finished yet.
|
||||
pub block_number: Option<BlockNumber>,
|
||||
|
||||
@ -1,12 +1,13 @@
|
||||
use crate::{segment::PrunePurpose, PruneSegment, PruneSegmentError};
|
||||
use alloy_primitives::BlockNumber;
|
||||
use reth_codecs::{reth_codec, Compact};
|
||||
use reth_codecs::{add_arbitrary_tests, Compact};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Prune mode.
|
||||
#[reth_codec]
|
||||
#[derive(Debug, PartialEq, Eq, Clone, Copy, Serialize, Deserialize)]
|
||||
#[derive(Debug, PartialEq, Eq, Clone, Copy, Serialize, Deserialize, Compact)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
#[cfg_attr(test, derive(arbitrary::Arbitrary))]
|
||||
#[add_arbitrary_tests(compact)]
|
||||
pub enum PruneMode {
|
||||
/// Prune all blocks.
|
||||
Full,
|
||||
|
||||
@ -1,14 +1,26 @@
|
||||
use crate::MINIMUM_PRUNING_DISTANCE;
|
||||
use derive_more::Display;
|
||||
use reth_codecs::{reth_codec, Compact};
|
||||
use reth_codecs::{add_arbitrary_tests, Compact};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use thiserror::Error;
|
||||
|
||||
/// Segment of the data that can be pruned.
|
||||
#[reth_codec]
|
||||
#[derive(
|
||||
Debug, Display, Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize,
|
||||
Debug,
|
||||
Display,
|
||||
Clone,
|
||||
Copy,
|
||||
Eq,
|
||||
PartialEq,
|
||||
Ord,
|
||||
PartialOrd,
|
||||
Hash,
|
||||
Serialize,
|
||||
Deserialize,
|
||||
Compact,
|
||||
)]
|
||||
#[cfg_attr(test, derive(arbitrary::Arbitrary))]
|
||||
#[add_arbitrary_tests(compact)]
|
||||
pub enum PruneSegment {
|
||||
/// Prune segment responsible for the `TransactionSenders` table.
|
||||
SenderRecovery,
|
||||
|
||||
Reference in New Issue
Block a user