Skip to content

Commit

Permalink
chore: bump alloy 0.4 (paradigmxyz#206)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored and lwedge99 committed Oct 8, 2024
1 parent f902cff commit 0e54830
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ clippy.lint_groups_priority = "allow"

[dependencies]
# eth
alloy-rpc-types-eth = "0.3"
alloy-rpc-types-trace = "0.3"
alloy-rpc-types-eth = "0.4"
alloy-rpc-types-trace = "0.4"
alloy-sol-types = "0.8"
alloy-primitives = "0.8"
revm = { version = "14", default-features = false, features = ["std"] }
alloy-primitives = { version = "0.8", features = ["map"] }
revm = { version = "14.0.3", default-features = false, features = ["std"] }

anstyle = "1.0"
colorchoice = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion src/tracing/builder/geth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl GethTraceBuilder<'static> {
impl<'a> GethTraceBuilder<'a> {
/// Returns a new instance of the builder from [`Cow::Borrowed`]
pub fn new_borrowed(
nodes: &'a Vec<CallTraceNode>,
nodes: &'a [CallTraceNode],
_config: TracingInspectorConfig,
) -> GethTraceBuilder<'a> {
Self { nodes: Cow::Borrowed(nodes), _config }
Expand Down
5 changes: 2 additions & 3 deletions src/tracing/mux.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::tracing::{FourByteInspector, TracingInspector, TracingInspectorConfig};
use alloy_primitives::{Address, Log, U256};
use alloy_primitives::{map::HashMap, Address, Log, U256};
use alloy_rpc_types_trace::geth::{
mux::{MuxConfig, MuxFrame},
CallConfig, FourByteFrame, GethDebugBuiltInTracerType, GethDebugTracerConfig, GethTrace,
Expand All @@ -12,7 +12,6 @@ use revm::{
primitives::ResultAndState,
Database, DatabaseRef, EvmContext, Inspector,
};
use std::collections::HashMap;
use thiserror::Error;

/// Mux tracing inspector that runs and collects results of multiple inspectors at once.
Expand Down Expand Up @@ -41,7 +40,7 @@ impl MuxInspector {
result: &ResultAndState,
db: &DB,
) -> Result<MuxFrame, DB::Error> {
let mut frame = HashMap::with_capacity(self.0.len());
let mut frame = HashMap::with_capacity_and_hasher(self.0.len(), Default::default());
for (tracer_type, inspector) in &self.0 {
let trace = match inspector {
DelegatingInspector::FourByte(inspector) => FourByteFrame::from(inspector).into(),
Expand Down
7 changes: 3 additions & 4 deletions tests/it/geth.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Geth tests
use crate::utils::inspect;
use alloy_primitives::{hex, Address, Bytes};
use alloy_primitives::{hex, map::HashMap, Address, Bytes};
use alloy_rpc_types_trace::geth::{
mux::MuxConfig, CallConfig, GethDebugBuiltInTracerType, GethDebugTracerConfig, GethTrace,
PreStateConfig,
Expand All @@ -15,7 +15,6 @@ use revm::{
DatabaseCommit,
};
use revm_inspectors::tracing::{MuxInspector, TracingInspector, TracingInspectorConfig};
use std::collections::HashMap;

#[test]
fn test_geth_calltracer_logs() {
Expand Down Expand Up @@ -184,12 +183,12 @@ fn test_geth_mux_tracer() {
let prestate_config = PreStateConfig { diff_mode: Some(false) };

let nested_call_config = CallConfig { only_top_call: Some(true), with_log: Some(false) };
let nested_mux_config = MuxConfig(HashMap::from([(
let nested_mux_config = MuxConfig(HashMap::from_iter([(
GethDebugBuiltInTracerType::CallTracer,
Some(GethDebugTracerConfig(serde_json::to_value(nested_call_config).unwrap())),
)]));

let config = MuxConfig(HashMap::from([
let config = MuxConfig(HashMap::from_iter([
(GethDebugBuiltInTracerType::FourByteTracer, None),
(
GethDebugBuiltInTracerType::CallTracer,
Expand Down

0 comments on commit 0e54830

Please sign in to comment.