From 067e697b9af345d3d12cdbdbe579b2a594bf5f4c Mon Sep 17 00:00:00 2001 From: Md Amaan Date: Tue, 3 Sep 2024 10:29:42 +0530 Subject: [PATCH] fixed imports --- crates/optimism/consensus/Cargo.toml | 20 +++++++++++++++-- crates/optimism/consensus/src/proof.rs | 31 ++++++++++++++++++++++---- 2 files changed, 45 insertions(+), 6 deletions(-) diff --git a/crates/optimism/consensus/Cargo.toml b/crates/optimism/consensus/Cargo.toml index bc717b941de7..979d6a74591f 100644 --- a/crates/optimism/consensus/Cargo.toml +++ b/crates/optimism/consensus/Cargo.toml @@ -13,13 +13,29 @@ workspace = true [dependencies] # reth -reth-consensus-common.workspace = true +reth-blockchain-tree.workspace = true +reth-blockchain-tree-api.workspace = true reth-chainspec.workspace = true -reth-primitives.workspace = true +reth-consensus-common.workspace = true reth-consensus.workspace = true +reth-db.workspace = true +reth-revm.workspace = true +reth-provider.workspace = true +reth-trie = { workspace = true, features = ["metrics"] } +reth-primitives.workspace = true reth-trie-common.workspace = true +reth-prune-types.workspace = true tracing.workspace = true +[dev-dependencies] +alloy-genesis.workspace = true +reth-chainspec.workspace = true +reth-revm.workspace = true +reth-primitives = { workspace = true, features = ["test-utils"] } +reth-provider = { workspace = true, features = ["test-utils"] } +reth-consensus = { workspace = true, features = ["test-utils"] } + + [features] optimism = ["reth-primitives/optimism"] diff --git a/crates/optimism/consensus/src/proof.rs b/crates/optimism/consensus/src/proof.rs index bae0855d7038..4e6f21d1d6c2 100644 --- a/crates/optimism/consensus/src/proof.rs +++ b/crates/optimism/consensus/src/proof.rs @@ -37,10 +37,33 @@ pub(crate) fn calculate_receipt_root_optimism( #[cfg(test)] mod tests { - use super::*; - use alloy_primitives::{b256, Address, LogData}; - use reth_chainspec::SEPOLIA; - use reth_primitives::{bloom, hex_literal::hex, Log, TxType}; + use std::{ + collections::{btree_map::Entry, BTreeMap, HashSet, HashMap}, + sync::Arc, + }; + use reth_blockchain_tree::{ + BlockchainTreeConfig, TreeExternals + }; + use reth_blockchain_tree_api::{ + BlockAttachment, BlockStatus, BlockValidationKind, CanonicalOutcome, InsertPayloadOk, + }; + use reth_db::tables; + use alloy_genesis::{Genesis, GenesisAccount}; + use reth_consensus::test_utils::TestConsensus; + use reth_evm_ethereum::execute::EthExecutorProvider; + use alloy_primitives::{U256, b256, Address, LogData}; + use reth_chainspec::{ChainSpecBuilder, SEPOLIA, MAINNET}; + use reth_primitives::{ + constants::{EIP1559_INITIAL_BASE_FEE, EMPTY_ROOT_HASH}, + keccak256, + proofs::{calculate_receipt_root, calculate_transaction_root}, + revm_primitives::AccountInfo, + Account, Address, Header, Receipt, SealedBlockWithSenders, Signature, Transaction, TransactionSigned, + TransactionSignedEcRecovered, TxEip1559, Withdrawals, B256, SealedBlock + }; + use reth_provider::test_utils::create_test_provider_factory_with_chain_spec; + use reth_trie::{root::state_root_unhashed}; + use reth_prune_types::PruneModes; #[test] fn consecutive_reorgs() {