Skip to content

Commit

Permalink
chore(primitives): replace HashMap re-exports with alloy_primitives::map
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes committed Sep 25, 2024
1 parent e477c7f commit af676c2
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 33 deletions.
29 changes: 21 additions & 8 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion bins/revme/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ inspector = { workspace = true, features = ["std", "serde-json"] }
bytecode = { workspace = true, features = ["std", "parse"] }

hash-db = "0.15"
hex = "0.4"
hashbrown = "0.14"
indicatif = "0.17"
microbench = "0.5"
Expand Down
2 changes: 1 addition & 1 deletion bins/revme/src/cmd/bench/analysis.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use database::{BenchmarkDB, EthereumBenchmarkWiring};
use revm::{
bytecode::Bytecode,
primitives::{address, bytes, Bytes, TxKind},
primitives::{address, bytes, hex, Bytes, TxKind},
Evm,
};
use std::time::Instant;
Expand Down
2 changes: 1 addition & 1 deletion bins/revme/src/cmd/bytecode.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use clap::Parser;
use revm::{
bytecode::eof::{self, validate_eof_inner, CodeType, Eof, EofError},
primitives::{Bytes, MAX_INITCODE_SIZE},
primitives::{hex, Bytes, MAX_INITCODE_SIZE},
};
use std::io;

Expand Down
2 changes: 1 addition & 1 deletion bins/revme/src/cmd/evmrunner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use database::BenchmarkDB;
use inspector::{inspector_handle_register, inspectors::TracerEip3155};
use revm::{
bytecode::{Bytecode, BytecodeDecodeError},
primitives::{address, Address, TxKind},
primitives::{address, hex, Address, TxKind},
wiring::EthereumWiring,
Database, Evm,
};
Expand Down
16 changes: 5 additions & 11 deletions crates/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,16 @@ rust_2018_idioms = "deny"
all = "warn"

[dependencies]
alloy-primitives = { version = "0.8.2", default-features = false, features = [
alloy-primitives = { version = "0.8.4", default-features = false, features = [
"rlp",
"map",
] }
hashbrown = "0.14"

# utils
cfg-if = { version = "1.0", default-features = false }

[build-dependencies]
hex = { version = "0.4", default-features = false }

[features]
default = ["std"]
std = ["alloy-primitives/std", "hex/std"]
hashbrown = []
serde = ["alloy-primitives/serde", "hex/serde", "hashbrown/serde"]
std = ["alloy-primitives/std"]
hashbrown = ["alloy-primitives/map-hashbrown"]
serde = ["alloy-primitives/serde"]
arbitrary = ["std", "alloy-primitives/arbitrary"]
asm-keccak = ["alloy-primitives/asm-keccak"]
rand = ["alloy-primitives/rand"]
13 changes: 3 additions & 10 deletions crates/primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,14 @@
#![cfg_attr(not(feature = "std"), no_std)]

mod constants;
pub use constants::*;

pub use alloy_primitives::{
self, address, b256, bytes, fixed_bytes, hex, hex_literal, keccak256, ruint, uint, Address,
Bytes, FixedBytes, Log, LogData, TxKind, B256, I256, U256,
};

pub use constants::*;

cfg_if::cfg_if! {
if #[cfg(all(not(feature = "hashbrown"), feature = "std"))] {
pub use std::collections::{hash_map, hash_set, HashMap, HashSet};
use hashbrown as _;
} else {
pub use hashbrown::{hash_map, hash_set, HashMap, HashSet};
}
}
pub use alloy_primitives::map::{self, hash_map, hash_set, HashMap, HashSet};

/// The Keccak-256 hash of the empty string `""`.
pub const KECCAK_EMPTY: B256 =
Expand Down

0 comments on commit af676c2

Please sign in to comment.