Skip to content

Commit

Permalink
Rename core trait to common. (#1911)
Browse files Browse the repository at this point in the history
**Motivation**
To be in line with the folder name, which is `common`.
  • Loading branch information
mpaulucci authored Feb 11, 2025
1 parent 2e91897 commit 34a7b6f
Show file tree
Hide file tree
Showing 134 changed files with 235 additions and 235 deletions.
36 changes: 18 additions & 18 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ edition = "2021"

[workspace.dependencies]
ethrex-blockchain = { path = "./crates/blockchain" }
ethrex-core = { path = "./crates/common" }
ethrex-common = { path = "./crates/common" }
ethrex-p2p = { path = "./crates/networking/p2p" }
ethrex-rpc = { path = "./crates/networking/rpc" }
ethrex-storage = { path = "./crates/storage/store" }
Expand Down
2 changes: 1 addition & 1 deletion cmd/ef_tests/blockchain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition.workspace = true

[dependencies]
ethrex-blockchain.workspace = true
ethrex-core.workspace = true
ethrex-common.workspace = true
ethrex-storage.workspace = true
ethrex-rlp.workspace = true
ethrex-vm.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion cmd/ef_tests/blockchain/network.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use ethrex_core::types::ChainConfig;
use ethrex_common::types::ChainConfig;
use lazy_static::lazy_static;
use serde::Deserialize;

Expand Down
2 changes: 1 addition & 1 deletion cmd/ef_tests/blockchain/test_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::{collections::HashMap, path::Path};

use crate::types::{BlockWithRLP, TestUnit};
use ethrex_blockchain::{add_block, fork_choice::apply_fork_choice};
use ethrex_core::types::{
use ethrex_common::types::{
Account as CoreAccount, Block as CoreBlock, BlockHeader as CoreBlockHeader,
};
use ethrex_rlp::decode::RLPDecode;
Expand Down
22 changes: 11 additions & 11 deletions cmd/ef_tests/blockchain/types.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use bytes::Bytes;
use ethrex_core::types::{
use ethrex_common::types::{
code_hash, Account as ethrexAccount, AccountInfo, Block as CoreBlock, BlockBody,
EIP1559Transaction, EIP2930Transaction, EIP4844Transaction, LegacyTransaction,
Transaction as ethrexTransaction, TxKind,
};
use ethrex_core::types::{Genesis, GenesisAccount, Withdrawal};
use ethrex_core::{types::BlockHeader, Address, Bloom, H256, H64, U256};
use ethrex_common::types::{Genesis, GenesisAccount, Withdrawal};
use ethrex_common::{types::BlockHeader, Address, Bloom, H256, H64, U256};
use serde::{Deserialize, Serialize};
use std::collections::HashMap;

Expand All @@ -18,7 +18,7 @@ pub struct TestUnit {
pub info: Option<serde_json::Value>,
pub blocks: Vec<BlockWithRLP>,
pub genesis_block_header: Header,
#[serde(rename = "genesisRLP", with = "ethrex_core::serde_utils::bytes")]
#[serde(rename = "genesisRLP", with = "ethrex_common::serde_utils::bytes")]
pub genesis_rlp: Bytes,
pub lastblockhash: H256,
pub network: Network,
Expand All @@ -37,11 +37,11 @@ pub struct FixtureConfig {
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ForkBlobSchedule {
#[serde(default, with = "ethrex_core::serde_utils::u64::hex_str")]
#[serde(default, with = "ethrex_common::serde_utils::u64::hex_str")]
pub target: u64,
#[serde(default, with = "ethrex_core::serde_utils::u64::hex_str")]
#[serde(default, with = "ethrex_common::serde_utils::u64::hex_str")]
pub max: u64,
#[serde(default, with = "ethrex_core::serde_utils::u64::hex_str")]
#[serde(default, with = "ethrex_common::serde_utils::u64::hex_str")]
pub base_fee_update_fraction: u64,
}

Expand Down Expand Up @@ -96,7 +96,7 @@ impl TestUnit {
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
pub struct Account {
pub balance: U256,
#[serde(with = "ethrex_core::serde_utils::bytes")]
#[serde(with = "ethrex_common::serde_utils::bytes")]
pub code: Bytes,
pub nonce: U256,
pub storage: HashMap<U256, U256>,
Expand Down Expand Up @@ -135,7 +135,7 @@ pub struct Header {
pub bloom: Bloom,
pub coinbase: Address,
pub difficulty: U256,
#[serde(with = "ethrex_core::serde_utils::bytes")]
#[serde(with = "ethrex_common::serde_utils::bytes")]
pub extra_data: Bytes,
pub gas_limit: U256,
pub gas_used: U256,
Expand All @@ -160,7 +160,7 @@ pub struct Header {
#[derive(Debug, PartialEq, Eq, Deserialize, Clone)]
#[serde(rename_all = "camelCase")]
pub struct BlockWithRLP {
#[serde(with = "ethrex_core::serde_utils::bytes")]
#[serde(with = "ethrex_common::serde_utils::bytes")]
pub rlp: Bytes,
#[serde(flatten)]
inner: Option<BlockInner>,
Expand Down Expand Up @@ -217,7 +217,7 @@ impl From<Block> for CoreBlock {
pub struct Transaction {
#[serde(rename = "type")]
pub transaction_type: Option<U256>,
#[serde(with = "ethrex_core::serde_utils::bytes")]
#[serde(with = "ethrex_common::serde_utils::bytes")]
pub data: Bytes,
pub gas_limit: U256,
pub gas_price: Option<U256>,
Expand Down
2 changes: 1 addition & 1 deletion cmd/ef_tests/state/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition.workspace = true

[dependencies]
ethrex-blockchain = { workspace = true }
ethrex-core.workspace = true
ethrex-common.workspace = true
ethrex-storage.workspace = true
ethrex-rlp.workspace = true
ethrex-vm = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion cmd/ef_tests/state/deserialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::types::{
TransactionExpectedException,
};
use bytes::Bytes;
use ethrex_core::{types::Fork, H256, U256};
use ethrex_common::{types::Fork, H256, U256};
use serde::{Deserialize, Deserializer};
use std::{collections::HashMap, str::FromStr};

Expand Down
4 changes: 2 additions & 2 deletions cmd/ef_tests/state/report.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::runner::{EFTestRunnerError, InternalError};
use colored::Colorize;
use ethrex_core::{types::Fork, Address, H256};
use ethrex_common::{types::Fork, Address, H256};
use ethrex_levm::{
errors::{ExecutionReport, TxResult, VMError},
Account, StorageSlot,
Expand Down Expand Up @@ -128,7 +128,7 @@ pub fn summary_for_slack(reports: &[EFTestReport]) -> String {
"text": {{
"type": "mrkdwn",
"text": "*Summary*: {total_passed}/{total_run} ({success_percentage:.2}%)\n\n{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}\n"
}}
}}
}}
]
}}"#,
Expand Down
2 changes: 1 addition & 1 deletion cmd/ef_tests/state/runner/levm_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::{
types::{EFTest, TransactionExpectedException},
utils::{self, effective_gas_price},
};
use ethrex_core::{
use ethrex_common::{
types::{code_hash, tx_fields::*, AccountInfo, Fork},
H256, U256,
};
Expand Down
4 changes: 2 additions & 2 deletions cmd/ef_tests/state/runner/revm_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::{
utils::{effective_gas_price, load_initial_state},
};
use bytes::Bytes;
use ethrex_core::{
use ethrex_common::{
types::{Fork, TxKind},
Address, H256,
};
Expand Down Expand Up @@ -61,7 +61,7 @@ pub fn re_run_failed_ef_test(
}
}
},
// Currently, we decided not to re-execute the test when the Expected exception does not match
// Currently, we decided not to re-execute the test when the Expected exception does not match
// with the received. This can change in the future.
EFTestRunnerError::ExpectedExceptionDoesNotMatchReceived(_) => continue,
EFTestRunnerError::VMInitializationFailed(_)
Expand Down
2 changes: 1 addition & 1 deletion cmd/ef_tests/state/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::{
report::TestVector,
};
use bytes::Bytes;
use ethrex_core::{
use ethrex_common::{
types::{Fork, Genesis, GenesisAccount, TxKind},
Address, H256, U256,
};
Expand Down
2 changes: 1 addition & 1 deletion cmd/ef_tests/state/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::{
runner::{EFTestRunnerError, InternalError},
types::{EFTest, EFTestTransaction},
};
use ethrex_core::{types::Genesis, H256, U256};
use ethrex_common::{types::Genesis, H256, U256};
use ethrex_storage::{EngineType, Store};
use ethrex_vm::db::{evm_state, EvmState};
use spinoff::Spinner;
Expand Down
2 changes: 1 addition & 1 deletion cmd/ethrex/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ edition = "2021"
[dependencies]
ethrex-blockchain.workspace = true
ethrex-rpc.workspace = true
ethrex-core.workspace = true
ethrex-common.workspace = true
ethrex-p2p.workspace = true
ethrex-storage = { workspace = true, optional = true }
ethrex-vm.workspace = true
Expand Down
4 changes: 2 additions & 2 deletions cmd/ethrex/decode.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use anyhow::Error;
use bytes::Bytes;
use ethrex_core::types::{Block, Genesis};
use ethrex_common::types::{Block, Genesis};
use ethrex_rlp::decode::RLPDecode as _;
use std::{
fs::File,
Expand Down Expand Up @@ -38,7 +38,7 @@ pub fn genesis_file(file: File) -> Result<Genesis, serde_json::Error> {
#[cfg(test)]
mod tests {
use crate::decode::chain_file;
use ethrex_core::H256;
use ethrex_common::H256;
use std::{fs::File, str::FromStr as _};

#[test]
Expand Down
4 changes: 2 additions & 2 deletions cmd/ethrex/ethrex.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use bytes::Bytes;
use directories::ProjectDirs;
use ethrex_blockchain::{add_block, fork_choice::apply_fork_choice};
use ethrex_core::types::{Block, Genesis};
use ethrex_common::types::{Block, Genesis};
use ethrex_p2p::{
kademlia::KademliaTable,
network::{node_id_from_signing_key, peer_table},
Expand Down Expand Up @@ -295,7 +295,7 @@ async fn main() {
head_block_hash,
max_tries,
1000,
ethrex_core::Address::default(),
ethrex_common::Address::default(),
);
tracker.spawn(block_producer_engine);
} else {
Expand Down
Loading

0 comments on commit 34a7b6f

Please sign in to comment.