Skip to content

Commit

Permalink
feat(primitives): other arbitrary impls
Browse files Browse the repository at this point in the history
  • Loading branch information
refcell committed Sep 4, 2024
1 parent e6aa159 commit 3062e4b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/primitives/src/chain_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use alloy_primitives::Address;
/// AltDA configuration.
#[derive(Debug, Clone, Default, Hash, Eq, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(any(test, feature = "arbitrary"), derive(arbitrary::Arbitrary))]
pub struct AltDAConfig {
/// AltDA challenge address
pub da_challenge_address: Option<Address>,
Expand All @@ -21,6 +22,7 @@ pub struct AltDAConfig {
/// Hardfork configuration.
#[derive(Debug, Clone, Default, Hash, Eq, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(any(test, feature = "arbitrary"), derive(arbitrary::Arbitrary))]
pub struct HardForkConfiguration {
/// Canyon hardfork activation time
pub canyon_time: Option<u64>,
Expand All @@ -39,6 +41,7 @@ pub struct HardForkConfiguration {
/// A chain configuration.
#[derive(Debug, Clone, Default, Hash, Eq, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(any(test, feature = "arbitrary"), derive(arbitrary::Arbitrary))]
pub struct ChainConfig {
/// Chain name (e.g. "Base")
#[cfg_attr(feature = "serde", serde(rename = "Name"))]
Expand Down
4 changes: 4 additions & 0 deletions crates/primitives/src/superchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use crate::HardForkConfiguration;
/// A superchain configuration.
#[derive(Debug, Clone, Default, Hash, Eq, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(any(test, feature = "arbitrary"), derive(arbitrary::Arbitrary))]
pub struct Superchain {
/// Superchain identifier, without capitalization or display changes.
pub name: String,
Expand All @@ -21,6 +22,7 @@ pub struct Superchain {
/// A superchain configuration file format
#[derive(Debug, Clone, Default, Hash, Eq, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(any(test, feature = "arbitrary"), derive(arbitrary::Arbitrary))]
pub struct SuperchainConfig {
/// Superchain name (e.g. "Mainnet")
#[cfg_attr(feature = "serde", serde(rename = "Name"))]
Expand All @@ -42,6 +44,7 @@ pub struct SuperchainConfig {
/// Superchain L1 anchor information
#[derive(Debug, Clone, Default, Hash, Eq, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(any(test, feature = "arbitrary"), derive(arbitrary::Arbitrary))]
pub struct SuperchainL1Info {
/// L1 chain ID
#[cfg_attr(feature = "serde", serde(rename = "ChainID"))]
Expand All @@ -60,6 +63,7 @@ pub struct SuperchainL1Info {
feature = "serde",
derive(serde_repr::Serialize_repr, serde_repr::Deserialize_repr)
)]
#[cfg_attr(any(test, feature = "arbitrary"), derive(arbitrary::Arbitrary))]
#[repr(u8)]
pub enum SuperchainLevel {
/// Frontier chains are chains with customizations beyond the
Expand Down

0 comments on commit 3062e4b

Please sign in to comment.