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: bump alloy 0.4 #206

Merged
merged 2 commits into from
Sep 30, 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
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
Loading