chore: rename executor -> blockchain-tree (#2285)

This commit is contained in:
Matthias Seitz
2023-04-17 16:32:18 +02:00
committed by GitHub
parent 29393420f6
commit db1e6cbeea
24 changed files with 46 additions and 68 deletions

View File

@@ -13,7 +13,7 @@ reth-interfaces = { path = "../interfaces" }
reth-provider = { path = "../storage/provider" }
reth-revm-primitives = { path = "./revm-primitives" }
reth-revm-inspectors = { path = "./revm-inspectors" }
reth-executor = { path = "../executor" }
reth-blockchain-tree = { path = "../blockchain-tree" }
reth-consensus-common = { path = "../consensus/common" }
# revm

View File

@@ -5,8 +5,8 @@ use crate::{
stack::{InspectorStack, InspectorStackConfig},
to_reth_acc,
};
use reth_blockchain_tree::post_state::PostState;
use reth_consensus_common::calc;
use reth_executor::post_state::PostState;
use reth_interfaces::executor::Error;
use reth_primitives::{
Account, Address, Block, Bloom, Bytecode, ChainSpec, Hardfork, Header, Receipt,
@@ -135,7 +135,7 @@ where
let mut drained_balance = U256::ZERO;
// drain all accounts ether
for address in reth_executor::eth_dao_fork::DAO_HARDKFORK_ACCOUNTS {
for address in reth_blockchain_tree::eth_dao_fork::DAO_HARDKFORK_ACCOUNTS {
let db_account = db.load_account(address).map_err(|_| Error::ProviderError)?;
let old = to_reth_acc(&db_account.info);
// drain balance
@@ -146,7 +146,7 @@ where
}
// add drained ether to beneficiary.
let beneficiary = reth_executor::eth_dao_fork::DAO_HARDFORK_BENEFICIARY;
let beneficiary = reth_blockchain_tree::eth_dao_fork::DAO_HARDFORK_BENEFICIARY;
self.increment_account_balance(beneficiary, drained_balance, post_state)?;
Ok(())
@@ -875,7 +875,7 @@ mod tests {
let mut beneficiary_balance = 0;
for (i, dao_address) in
reth_executor::eth_dao_fork::DAO_HARDKFORK_ACCOUNTS.iter().enumerate()
reth_blockchain_tree::eth_dao_fork::DAO_HARDKFORK_ACCOUNTS.iter().enumerate()
{
db.insert_account(
*dao_address,
@@ -913,10 +913,10 @@ mod tests {
// beneficiary
let db = executor.db();
let dao_beneficiary =
db.accounts.get(&reth_executor::eth_dao_fork::DAO_HARDFORK_BENEFICIARY).unwrap();
db.accounts.get(&reth_blockchain_tree::eth_dao_fork::DAO_HARDFORK_BENEFICIARY).unwrap();
assert_eq!(dao_beneficiary.info.balance, U256::from(beneficiary_balance));
for address in reth_executor::eth_dao_fork::DAO_HARDKFORK_ACCOUNTS.iter() {
for address in reth_blockchain_tree::eth_dao_fork::DAO_HARDKFORK_ACCOUNTS.iter() {
let account = db.accounts.get(address).unwrap();
assert_eq!(account.info.balance, U256::ZERO);
}
@@ -924,14 +924,14 @@ mod tests {
// check changesets
let beneficiary_state = out
.accounts()
.get(&reth_executor::eth_dao_fork::DAO_HARDFORK_BENEFICIARY)
.get(&reth_blockchain_tree::eth_dao_fork::DAO_HARDFORK_BENEFICIARY)
.unwrap()
.unwrap();
assert_eq!(
beneficiary_state,
Account { balance: U256::from(beneficiary_balance), ..Default::default() },
);
for address in reth_executor::eth_dao_fork::DAO_HARDKFORK_ACCOUNTS.iter() {
for address in reth_blockchain_tree::eth_dao_fork::DAO_HARDKFORK_ACCOUNTS.iter() {
let updated_account = out.accounts().get(address).unwrap().unwrap();
assert_eq!(updated_account, Account { balance: U256::ZERO, ..Default::default() });
}