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

primitives: remove optimism re-export in reth-primitives #11438

Merged
merged 2 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
10 changes: 4 additions & 6 deletions crates/optimism/evm/src/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -468,10 +468,8 @@ mod tests {
use alloy_consensus::TxEip1559;
use alloy_primitives::{b256, Address, StorageKey, StorageValue};
use reth_chainspec::{ChainSpecBuilder, MIN_TRANSACTION_GAS};
use reth_optimism_chainspec::optimism_deposit_tx_signature;
use reth_primitives::{
Account, Block, BlockBody, Signature, Transaction, TransactionSigned, BASE_MAINNET,
};
use reth_optimism_chainspec::{optimism_deposit_tx_signature, BASE_MAINNET};
use reth_primitives::{Account, Block, BlockBody, Signature, Transaction, TransactionSigned};
use reth_revm::{
database::StateProviderDatabase, test_utils::StateProviderTest, L1_BLOCK_CONTRACT,
};
Expand Down Expand Up @@ -546,7 +544,7 @@ mod tests {
);

let tx_deposit = TransactionSigned::from_transaction_and_signature(
Transaction::Deposit(reth_primitives::TxDeposit {
Transaction::Deposit(reth_primitives::transaction::TxDeposit {
from: addr,
to: addr.into(),
gas_limit: MIN_TRANSACTION_GAS,
Expand Down Expand Up @@ -630,7 +628,7 @@ mod tests {
);

let tx_deposit = TransactionSigned::from_transaction_and_signature(
Transaction::Deposit(reth_primitives::TxDeposit {
Transaction::Deposit(reth_primitives::transaction::TxDeposit {
from: addr,
to: addr.into(),
gas_limit: MIN_TRANSACTION_GAS,
Expand Down
3 changes: 2 additions & 1 deletion crates/optimism/evm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,10 @@ mod tests {
use alloy_primitives::{B256, U256};
use reth_chainspec::{Chain, ChainSpec};
use reth_evm::execute::ProviderError;
use reth_optimism_chainspec::BASE_MAINNET;
use reth_primitives::{
revm_primitives::{BlockEnv, CfgEnv, SpecId},
Header, BASE_MAINNET, KECCAK_EMPTY,
Header, KECCAK_EMPTY,
};
use reth_revm::{
db::{CacheDB, EmptyDBTyped},
Expand Down
2 changes: 1 addition & 1 deletion crates/optimism/node/src/txpool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ mod tests {
use reth::primitives::Signature;
use reth_chainspec::MAINNET;
use reth_primitives::{
Transaction, TransactionSigned, TransactionSignedEcRecovered, TxDeposit,
transaction::TxDeposit, Transaction, TransactionSigned, TransactionSignedEcRecovered,
};
use reth_provider::test_utils::MockEthProvider;
use reth_transaction_pool::{
Expand Down
2 changes: 1 addition & 1 deletion crates/optimism/node/tests/it/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
use reth_db::test_utils::create_test_rw_db;
use reth_node_api::FullNodeComponents;
use reth_node_builder::{NodeBuilder, NodeConfig};
use reth_optimism_chainspec::BASE_MAINNET;
use reth_optimism_node::{node::OptimismAddOns, OptimismNode};
use reth_primitives::BASE_MAINNET;

#[test]
fn test_basic_setup() {
Expand Down
10 changes: 0 additions & 10 deletions crates/primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,6 @@ 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::transaction::{optimism_deposit_tx_signature, TxDeposit, DEPOSIT_TX_TYPE_ID};
tcoratger marked this conversation as resolved.
Show resolved Hide resolved
pub use reth_optimism_chainspec::{BASE_MAINNET, BASE_SEPOLIA, OP_MAINNET, OP_SEPOLIA};
}

#[cfg(feature = "optimism")]
pub use optimism::*;

/// Bincode-compatible serde implementations for commonly used types in Reth.
///
/// `bincode` crate doesn't work with optionally serializable serde fields, but some of the
Expand Down
4 changes: 2 additions & 2 deletions crates/primitives/src/receipt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ impl Decodable for ReceiptWithBloom {
Self::decode_receipt(buf, TxType::Eip7702)
}
#[cfg(feature = "optimism")]
crate::DEPOSIT_TX_TYPE_ID => {
crate::transaction::DEPOSIT_TX_TYPE_ID => {
buf.advance(1);
Self::decode_receipt(buf, TxType::Deposit)
}
Expand Down Expand Up @@ -468,7 +468,7 @@ impl<'a> ReceiptWithBloomEncoder<'a> {
}
#[cfg(feature = "optimism")]
TxType::Deposit => {
out.put_u8(crate::DEPOSIT_TX_TYPE_ID);
out.put_u8(crate::transaction::DEPOSIT_TX_TYPE_ID);
}
}
out.put_slice(payload.as_ref());
Expand Down
Loading