Skip to content

Commit

Permalink
chore(trie): remove reth-primitives dep
Browse files Browse the repository at this point in the history
  • Loading branch information
Rjected committed Jan 29, 2025
1 parent 665ca2e commit 4050636
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 11 deletions.
3 changes: 2 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions crates/trie/trie/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ workspace = true
[dependencies]
# reth
reth-execution-errors.workspace = true
reth-primitives.workspace = true
reth-primitives-traits.workspace = true
reth-stages-types.workspace = true
reth-storage-errors.workspace = true
reth-trie-sparse.workspace = true
Expand Down Expand Up @@ -46,7 +46,8 @@ triehash = { version = "0.8", optional = true }

[dev-dependencies]
# reth
reth-primitives = { workspace = true, features = ["test-utils", "arbitrary"] }
reth-primitives-traits = { workspace = true, features = ["test-utils", "arbitrary"] }
reth-ethereum-primitives = { workspace = true, features = ["test-utils", "arbitrary"] }
reth-trie-common = { workspace = true, features = ["test-utils", "arbitrary"] }

# trie
Expand All @@ -67,12 +68,14 @@ serde = [
"alloy-eips/serde",
"revm/serde",
"reth-trie-common/serde",
"reth-primitives-traits/serde",
]
test-utils = [
"triehash",
"revm/test-utils",
"reth-primitives/test-utils",
"reth-primitives-traits/test-utils",
"reth-trie-common/test-utils",
"reth-ethereum-primitives/test-utils",
"reth-trie-sparse/test-utils",
"reth-stages-types/test-utils",
]
Expand Down
4 changes: 2 additions & 2 deletions crates/trie/trie/benches/trie_root.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#![allow(missing_docs, unreachable_pub)]
use alloy_consensus::ReceiptWithBloom;
use alloy_primitives::B256;
use criterion::{criterion_group, criterion_main, Criterion};
use proptest::{prelude::*, strategy::ValueTree, test_runner::TestRunner};
use proptest_arbitrary_interop::arb;
use reth_primitives::{Receipt, ReceiptWithBloom};
use reth_ethereum_primitives::Receipt;
use reth_trie::triehash::KeccakHasher;
use std::hint::black_box;

Expand Down Expand Up @@ -47,7 +48,6 @@ mod implementations {
use alloy_eips::eip2718::Encodable2718;
use alloy_rlp::Encodable;
use alloy_trie::root::adjust_index_for_rlp;
use reth_primitives::Receipt;
use reth_trie_common::{HashBuilder, Nibbles};

pub fn trie_hash_ordered_trie_root(receipts: &[ReceiptWithBloom<Receipt>]) -> B256 {
Expand Down
2 changes: 1 addition & 1 deletion crates/trie/trie/src/hashed_cursor/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use alloy_primitives::{B256, U256};
use reth_primitives::Account;
use reth_primitives_traits::Account;
use reth_storage_errors::db::DatabaseError;

/// Implementation of hashed state cursor traits for the post state.
Expand Down
2 changes: 1 addition & 1 deletion crates/trie/trie/src/hashed_cursor/noop.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use super::{HashedCursor, HashedCursorFactory, HashedStorageCursor};
use alloy_primitives::{B256, U256};
use reth_primitives::Account;
use reth_primitives_traits::Account;
use reth_storage_errors::db::DatabaseError;

/// Noop hashed cursor factory.
Expand Down
2 changes: 1 addition & 1 deletion crates/trie/trie/src/hashed_cursor/post_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::{
HashedStorageSorted,
};
use alloy_primitives::{map::B256HashSet, B256, U256};
use reth_primitives::Account;
use reth_primitives_traits::Account;
use reth_storage_errors::db::DatabaseError;

/// The hashed cursor factory for the post state.
Expand Down
2 changes: 1 addition & 1 deletion crates/trie/trie/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use alloy_primitives::{
};
use itertools::Itertools;
use rayon::prelude::{IntoParallelIterator, ParallelIterator};
use reth_primitives::Account;
use reth_primitives_traits::Account;
use reth_trie_common::KeyHasher;
use revm::db::{AccountStatus, BundleAccount};
use std::borrow::Cow;
Expand Down
2 changes: 1 addition & 1 deletion crates/trie/trie/src/test_utils.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use alloy_primitives::{Address, B256, U256};
use alloy_rlp::encode_fixed_size;
use reth_primitives::Account;
use reth_primitives_traits::Account;
use reth_trie_common::triehash::KeccakHasher;

/// Re-export of [triehash].
Expand Down

0 comments on commit 4050636

Please sign in to comment.