Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: move GotExpected, log and gas_units to reth-primitives-traits #8958

Merged
merged 5 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
use alloy_primitives::{address, b256, Address, B256, U256};
use core::time::Duration;

/// Gas units, for example [`GIGAGAS`](gas_units::GIGAGAS).
pub mod gas_units;

/// The client version: `reth/v{major}.{minor}.{patch}`
pub const RETH_CLIENT_VERSION: &str = concat!("reth/v", env!("CARGO_PKG_VERSION"));

Expand Down
6 changes: 6 additions & 0 deletions crates/primitives-traits/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ pub use request::{Request, Requests};
mod withdrawal;
pub use withdrawal::{Withdrawal, Withdrawals};

mod error;
pub use error::{GotExpected, GotExpectedBoxed};

mod log;
pub use log::{logs_bloom, Log};

mod storage;
pub use storage::StorageEntry;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::Bloom;

use alloy_primitives::Bloom;
pub use alloy_primitives::Log;

/// Calculate receipt logs bloom.
Expand Down
13 changes: 0 additions & 13 deletions crates/primitives/src/constants/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,5 @@

pub use reth_primitives_traits::constants::*;

/// Gas units, for example [`GIGAGAS`](gas_units::GIGAGAS).
pub mod gas_units;

/// [EIP-4844](https://eips.ethereum.org/EIPS/eip-4844#parameters) constants.
pub mod eip4844;

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn min_protocol_sanity() {
assert_eq!(MIN_PROTOCOL_BASE_FEE_U256.to::<u64>(), MIN_PROTOCOL_BASE_FEE);
}
}
7 changes: 2 additions & 5 deletions crates/primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@ mod block;
mod compression;
pub mod constants;
pub mod eip4844;
mod error;
pub mod genesis;
pub mod header;
mod log;
pub mod proofs;
mod receipt;
/// Helpers for working with revm
Expand All @@ -52,15 +50,14 @@ pub use constants::{
DEV_GENESIS_HASH, EMPTY_OMMER_ROOT_HASH, GOERLI_GENESIS_HASH, HOLESKY_GENESIS_HASH,
KECCAK_EMPTY, MAINNET_GENESIS_HASH, SEPOLIA_GENESIS_HASH,
};
pub use error::{GotExpected, GotExpectedBoxed};
pub use genesis::{ChainConfig, Genesis, GenesisAccount};
pub use header::{Header, HeadersDirection, SealedHeader};
pub use log::{logs_bloom, Log};
pub use receipt::{
gas_spent_by_transactions, Receipt, ReceiptWithBloom, ReceiptWithBloomRef, Receipts,
};
pub use reth_primitives_traits::{
Account, Bytecode, Request, Requests, StorageEntry, Withdrawal, Withdrawals,
logs_bloom, Account, Bytecode, GotExpected, GotExpectedBoxed, Log, Request, Requests,
StorageEntry, Withdrawal, Withdrawals,
};
pub use static_file::StaticFileSegment;

Expand Down
Loading