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): Other Arbitrary Implementations #9

Merged
merged 2 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
1 change: 1 addition & 0 deletions crates/primitives/src/genesis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use alloy_primitives::Bytes;
/// Chain genesis 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 ChainGenesis {
/// L1 genesis block
#[cfg_attr(feature = "serde", serde(rename = "L1"))]
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
2 changes: 2 additions & 0 deletions crates/primitives/src/system_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ pub const CONFIG_UPDATE_EVENT_VERSION_0: B256 = B256::ZERO;
#[derive(Debug, Clone, Default, Hash, Eq, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(any(test, feature = "arbitrary"), derive(arbitrary::Arbitrary))]
pub struct SystemConfig {
/// Batcher address
#[cfg_attr(feature = "serde", serde(rename = "batcherAddr"))]
Expand Down Expand Up @@ -219,6 +220,7 @@ impl SystemConfig {
/// System accounts
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(any(test, feature = "arbitrary"), derive(arbitrary::Arbitrary))]
pub struct SystemAccounts {
/// The address that can deposit attributes
pub attributes_depositor: Address,
Expand Down