Skip to content

Commit 133b413

Browse files
authored
feat(primitives): derive Default for SpecId (#1171)
1 parent 2aa0cd2 commit 133b413

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

crates/primitives/src/specification.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pub use SpecId::*;
77
/// Information was obtained from the [Ethereum Execution Specifications](https://github.com/ethereum/execution-specs)
88
#[cfg(not(feature = "optimism"))]
99
#[repr(u8)]
10-
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, enumn::N)]
10+
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash, enumn::N)]
1111
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1212
pub enum SpecId {
1313
FRONTIER = 0, // Frontier 0
@@ -28,6 +28,7 @@ pub enum SpecId {
2828
MERGE = 15, // Paris/Merge 15537394 (TTD: 58750000000000000000000)
2929
SHANGHAI = 16, // Shanghai 17034870 (TS: 1681338455)
3030
CANCUN = 17, // Cancun TBD
31+
#[default]
3132
LATEST = u8::MAX,
3233
}
3334

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

0 commit comments

Comments
 (0)