Skip to content

Commit 866caef

Browse files
committed
replace by alloy's one
1 parent 7874f0c commit 866caef

File tree

20 files changed

+96
-319
lines changed

20 files changed

+96
-319
lines changed

Cargo.lock

+3-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/blockchain-tree/Cargo.toml

+3-2
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ reth-provider = { workspace = true, features = ["test-utils"] }
5656
reth-evm = { workspace = true, features = ["test-utils"] }
5757
reth-consensus = { workspace = true, features = ["test-utils"] }
5858
reth-testing-utils.workspace = true
59+
reth-trie-common.workspace = true
5960
reth-revm.workspace = true
6061
reth-evm-ethereum.workspace = true
6162
reth-execution-types.workspace = true
@@ -77,12 +78,12 @@ test-utils = [
7778
"reth-db-api/test-utils",
7879
"reth-provider/test-utils",
7980
"reth-trie-db/test-utils",
80-
"reth-trie/test-utils"
81+
"reth-trie/test-utils",
8182
]
8283
optimism = [
8384
"reth-primitives/optimism",
8485
"reth-provider/optimism",
8586
"reth-execution-types/optimism",
8687
"reth-db/optimism",
87-
"reth-db-api/optimism"
88+
"reth-db-api/optimism",
8889
]

crates/blockchain-tree/src/blockchain_tree.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1402,6 +1402,7 @@ mod tests {
14021402
use reth_revm::primitives::AccountInfo;
14031403
use reth_stages_api::StageCheckpoint;
14041404
use reth_trie::{root::state_root_unhashed, StateRoot};
1405+
use reth_trie_common::from_account_info_to_trie_account;
14051406
use std::collections::HashMap;
14061407

14071408
fn setup_externals(
@@ -1624,7 +1625,7 @@ mod tests {
16241625
receipts_root,
16251626
state_root: state_root_unhashed(HashMap::from([(
16261627
signer,
1627-
(
1628+
from_account_info_to_trie_account(
16281629
AccountInfo {
16291630
balance: initial_signer_balance -
16301631
(single_tx_cost * U256::from(num_of_signer_txs)),

crates/chain-state/Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ reth-primitives.workspace = true
2121
reth-primitives-traits.workspace = true
2222
reth-storage-api.workspace = true
2323
reth-trie.workspace = true
24+
reth-trie-common = { workspace = true, optional = true }
2425

2526
# ethereum
2627
alloy-eips.workspace = true
@@ -62,5 +63,6 @@ test-utils = [
6263
"reth-primitives/test-utils",
6364
"reth-primitives-traits/test-utils",
6465
"reth-trie/test-utils",
66+
"reth-trie-common",
6567
"revm/test-utils",
6668
]

crates/chain-state/src/test_utils.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ use reth_primitives::{
2222
};
2323
use reth_storage_api::NodePrimitivesProvider;
2424
use reth_trie::{root::state_root_unhashed, updates::TrieUpdates, HashedPostState};
25+
use reth_trie_common::from_account_info_to_trie_account;
2526
use revm::{db::BundleState, primitives::AccountInfo};
2627
use std::{
2728
collections::HashMap,
@@ -150,7 +151,7 @@ impl TestBlockBuilder {
150151
beneficiary: Address::random(),
151152
state_root: state_root_unhashed(HashMap::from([(
152153
self.signer,
153-
(
154+
from_account_info_to_trie_account(
154155
AccountInfo {
155156
balance: initial_signer_balance - signer_balance_decrease,
156157
nonce: num_txs,

crates/storage/provider/Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ reth-db-api.workspace = true
2828
reth-prune-types.workspace = true
2929
reth-stages-types.workspace = true
3030
reth-trie = { workspace = true, features = ["metrics"] }
31+
reth-trie-common = { workspace = true, optional = true }
3132
reth-trie-db = { workspace = true, features = ["metrics"] }
3233
reth-nippy-jar.workspace = true
3334
reth-codecs.workspace = true
@@ -119,6 +120,7 @@ test-utils = [
119120
"reth-db/test-utils",
120121
"reth-nippy-jar/test-utils",
121122
"reth-trie/test-utils",
123+
"reth-trie-common",
122124
"reth-chain-state/test-utils",
123125
"reth-ethereum-engine-primitives",
124126
"reth-chainspec/test-utils",

crates/storage/provider/src/test_utils/blocks.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use reth_primitives::{
1616
TransactionSigned, TxType,
1717
};
1818
use reth_trie::root::{state_root_unhashed, storage_root_unhashed};
19+
use reth_trie_common::from_account_to_trie_account;
1920
use revm::{db::BundleState, primitives::AccountInfo};
2021
use std::{str::FromStr, sync::LazyLock};
2122

@@ -170,7 +171,7 @@ fn bundle_state_root(execution_outcome: &ExecutionOutcome) -> B256 {
170171
account.info.as_ref().map(|info| {
171172
(
172173
address,
173-
(
174+
from_account_to_trie_account(
174175
Account::from(info),
175176
storage_root_unhashed(
176177
account

crates/trie/common/Cargo.toml

+19-27
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,14 @@ workspace = true
1515
# alloy
1616
alloy-primitives.workspace = true
1717
alloy-rlp = { workspace = true, features = ["arrayvec"] }
18-
alloy-trie.workspace = true
18+
alloy-rpc-types-eth = { workspace = true, optional = true }
19+
alloy-serde = { workspace = true, optional = true }
20+
alloy-trie = { workspace = true, features = ["ethereum"] }
1921
alloy-consensus.workspace = true
2022
reth-primitives-traits.workspace = true
2123
reth-codecs = { workspace = true, optional = true }
2224
revm-primitives.workspace = true
2325

24-
alloy-genesis.workspace = true
25-
alloy-rpc-types-eth = { workspace = true, optional = true }
26-
alloy-serde = { workspace = true, optional = true }
27-
2826
bytes = { workspace = true, optional = true }
2927
derive_more.workspace = true
3028
itertools.workspace = true
@@ -59,10 +57,7 @@ serde_json.workspace = true
5957
serde_with.workspace = true
6058

6159
[features]
62-
eip1186 = [
63-
"alloy-rpc-types-eth/serde",
64-
"dep:alloy-serde",
65-
]
60+
eip1186 = ["alloy-rpc-types-eth/serde", "dep:alloy-serde"]
6661
serde = [
6762
"dep:serde",
6863
"bytes?/serde",
@@ -73,17 +68,14 @@ serde = [
7368
"alloy-rpc-types-eth?/serde",
7469
"revm-primitives/serde",
7570
"reth-primitives-traits/serde",
76-
"reth-codecs?/serde"
77-
]
78-
reth-codec = [
79-
"dep:reth-codecs",
80-
"dep:bytes",
71+
"reth-codecs?/serde",
8172
]
73+
reth-codec = ["dep:reth-codecs", "dep:bytes"]
8274
serde-bincode-compat = [
8375
"serde",
84-
"reth-primitives-traits/serde-bincode-compat",
85-
"alloy-consensus/serde-bincode-compat",
86-
"dep:serde_with"
76+
"reth-primitives-traits/serde-bincode-compat",
77+
"alloy-consensus/serde-bincode-compat",
78+
"dep:serde_with",
8779
]
8880
test-utils = [
8981
"dep:plain_hasher",
@@ -93,17 +85,17 @@ test-utils = [
9385
"reth-codecs/test-utils",
9486
]
9587
arbitrary = [
96-
"dep:reth-codecs",
97-
"alloy-trie/arbitrary",
98-
"dep:arbitrary",
88+
"dep:reth-codecs",
89+
"alloy-trie/arbitrary",
90+
"dep:arbitrary",
9991
"alloy-serde?/arbitrary",
100-
"reth-primitives-traits/arbitrary",
101-
"alloy-consensus/arbitrary",
102-
"alloy-primitives/arbitrary",
103-
"nybbles/arbitrary",
104-
"revm-primitives/arbitrary",
105-
"reth-codecs/arbitrary",
106-
"alloy-rpc-types-eth?/arbitrary"
92+
"reth-primitives-traits/arbitrary",
93+
"alloy-consensus/arbitrary",
94+
"alloy-primitives/arbitrary",
95+
"nybbles/arbitrary",
96+
"revm-primitives/arbitrary",
97+
"reth-codecs/arbitrary",
98+
"alloy-rpc-types-eth?/arbitrary",
10799
]
108100

109101
[[bench]]

0 commit comments

Comments
 (0)