From 0d70bf45d6ecdcd34623962a631f546a645389f9 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Fri, 1 Dec 2023 15:46:02 +0100 Subject: [PATCH] chore: group optimism reexports (#5652) --- crates/primitives/src/lib.rs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/crates/primitives/src/lib.rs b/crates/primitives/src/lib.rs index 36e55c6d2c..a8f3705dbc 100644 --- a/crates/primitives/src/lib.rs +++ b/crates/primitives/src/lib.rs @@ -57,8 +57,6 @@ pub use chain::{ ChainSpecBuilder, DisplayHardforks, ForkBaseFeeParams, ForkCondition, ForkTimestamps, NamedChain, DEV, GOERLI, HOLESKY, MAINNET, SEPOLIA, }; -#[cfg(feature = "optimism")] -pub use chain::{BASE_GOERLI, BASE_MAINNET, OP_GOERLI}; pub use compression::*; pub use constants::{ DEV_GENESIS_HASH, EMPTY_OMMER_ROOT_HASH, GOERLI_GENESIS_HASH, HOLESKY_GENESIS_HASH, @@ -98,8 +96,6 @@ pub use transaction::{ TxEip4844, TxHashOrNumber, TxLegacy, TxType, TxValue, EIP1559_TX_TYPE_ID, EIP2930_TX_TYPE_ID, EIP4844_TX_TYPE_ID, LEGACY_TX_TYPE_ID, }; -#[cfg(feature = "optimism")] -pub use transaction::{TxDeposit, DEPOSIT_TX_TYPE_ID}; pub use withdrawal::Withdrawal; // Re-exports @@ -133,3 +129,15 @@ pub use arbitrary; #[cfg(feature = "c-kzg")] pub use c_kzg as kzg; + +/// Optimism specific re-exports +#[cfg(feature = "optimism")] +mod optimism { + pub use crate::{ + chain::{BASE_GOERLI, BASE_MAINNET, OP_GOERLI}, + transaction::{TxDeposit, DEPOSIT_TX_TYPE_ID}, + }; +} + +#[cfg(feature = "optimism")] +pub use optimism::*;