Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(primitives): derive Default for SpecId #1171

Merged
merged 1 commit into from Mar 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions crates/primitives/src/specification.rs
Expand Up @@ -7,7 +7,7 @@ pub use SpecId::*;
/// Information was obtained from the [Ethereum Execution Specifications](https://github.com/ethereum/execution-specs)
#[cfg(not(feature = "optimism"))]
#[repr(u8)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, enumn::N)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash, enumn::N)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum SpecId {
FRONTIER = 0, // Frontier 0
Expand All @@ -28,6 +28,7 @@ pub enum SpecId {
MERGE = 15, // Paris/Merge 15537394 (TTD: 58750000000000000000000)
SHANGHAI = 16, // Shanghai 17034870 (TS: 1681338455)
CANCUN = 17, // Cancun TBD
#[default]
LATEST = u8::MAX,
}

Expand All @@ -36,7 +37,7 @@ pub enum SpecId {
/// Information was obtained from the [Ethereum Execution Specifications](https://github.com/ethereum/execution-specs)
#[cfg(feature = "optimism")]
#[repr(u8)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, enumn::N)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash, enumn::N)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum SpecId {
FRONTIER = 0,
Expand All @@ -61,6 +62,7 @@ pub enum SpecId {
CANYON = 19,
CANCUN = 20,
ECOTONE = 21,
#[default]
LATEST = u8::MAX,
}

Expand Down