Skip to content

Commit

Permalink
chore: flatten alloy-rpc-types (paradigmxyz#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
nkysg authored and lwedge99 committed Oct 8, 2024
1 parent 52bc8b0 commit 6c408ff
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 19 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ clippy.lint_groups_priority = "allow"

[dependencies]
# eth
alloy-rpc-types-eth = "0.3"
alloy-rpc-types-trace = "0.3"
alloy-sol-types = "0.8"
alloy-primitives = "0.8"
#alloy-rpc-types = { version = "0.3", features = ["eth", "trace"] }
alloy-rpc-types = { git = "https://github.com/sentioxyz/alloy", rev = "53a432b", features = ["eth", "trace"] }
revm = { version = "14", default-features = false, features = ["std"] }

anstyle = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion src/access_list.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use alloy_primitives::{Address, B256};
use alloy_rpc_types::{AccessList, AccessListItem};
use alloy_rpc_types_eth::{AccessList, AccessListItem};
use revm::{
interpreter::{opcode, Interpreter},
Database, EvmContext, Inspector,
Expand Down
2 changes: 1 addition & 1 deletion src/opcode.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use alloy_rpc_types::trace::opcode::OpcodeGas;
use alloy_rpc_types_trace::opcode::OpcodeGas;
use revm::{
interpreter::{
opcode::{self, OpCode},
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 @@ -6,7 +6,7 @@ use crate::tracing::{
TracingInspectorConfig,
};
use alloy_primitives::{Address, Bytes, B256, U256};
use alloy_rpc_types::trace::geth::{
use alloy_rpc_types_trace::geth::{
AccountChangeKind, AccountState, CallConfig, CallFrame, DefaultFrame, DiffMode,
GethDefaultTracingOptions, PreStateConfig, PreStateFrame, PreStateMode, StructLog,
};
Expand Down
3 changes: 2 additions & 1 deletion src/tracing/builder/parity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ use crate::tracing::{
TracingInspectorConfig,
};
use alloy_primitives::{Address, U256, U64};
use alloy_rpc_types::{trace::parity::*, TransactionInfo};
use alloy_rpc_types_eth::TransactionInfo;
use alloy_rpc_types_trace::parity::*;
use revm::{
db::DatabaseRef,
primitives::{Account, ExecutionResult, ResultAndState, SpecId, KECCAK_EMPTY},
Expand Down
10 changes: 5 additions & 5 deletions src/tracing/config.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use alloy_primitives::U256;
use alloy_rpc_types::trace::{
use alloy_rpc_types_trace::{
geth::{CallConfig, GethDefaultTracingOptions, PreStateConfig},
parity::TraceType,
};
Expand Down Expand Up @@ -129,7 +129,7 @@ impl TracingInspectorConfig {
/// This config does _not_ record opcode level traces and is suited for `debug_traceTransaction`
///
/// This will configure the default output of geth's default
/// [StructLogTracer](alloy_rpc_types::trace::geth::DefaultFrame).
/// [StructLogTracer](alloy_rpc_types_trace::geth::DefaultFrame).
pub const fn default_geth() -> Self {
Self {
record_steps: true,
Expand Down Expand Up @@ -162,7 +162,7 @@ impl TracingInspectorConfig {
/// Returns a config for geth style traces based on the given [GethDefaultTracingOptions].
///
/// This will configure the output of geth's default
/// [StructLogTracer](alloy_rpc_types::trace::geth::DefaultFrame) according to the given config.
/// [StructLogTracer](alloy_rpc_types_trace::geth::DefaultFrame) according to the given config.
#[inline]
pub fn from_geth_config(config: &GethDefaultTracingOptions) -> Self {
Self {
Expand All @@ -177,7 +177,7 @@ impl TracingInspectorConfig {
}
}

/// Returns a config for geth's [CallTracer](alloy_rpc_types::trace::geth::CallFrame).
/// Returns a config for geth's [CallTracer](alloy_rpc_types_trace::geth::CallFrame).
///
/// This returns [Self::none] and enables [TracingInspectorConfig::record_logs] if configured in
/// the given [CallConfig]
Expand All @@ -188,7 +188,7 @@ impl TracingInspectorConfig {
.set_record_logs(config.with_log.unwrap_or_default())
}

/// Returns a config for geth's [PrestateTracer](alloy_rpc_types::trace::geth::PreStateFrame).
/// Returns a config for geth's [PrestateTracer](alloy_rpc_types_trace::geth::PreStateFrame).
///
/// Note: This currently returns [Self::none] because the prestate tracer result currently
/// relies on the execution result entirely, see
Expand Down
2 changes: 1 addition & 1 deletion src/tracing/fourbyte.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
//! See also <https://geth.ethereum.org/docs/developers/evm-tracing/built-in-tracers>

use alloy_primitives::{hex, Selector};
use alloy_rpc_types::trace::geth::FourByteFrame;
use alloy_rpc_types_trace::geth::FourByteFrame;
use revm::{
interpreter::{CallInputs, CallOutcome},
Database, EvmContext, Inspector,
Expand Down
2 changes: 1 addition & 1 deletion src/tracing/mux.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::tracing::{FourByteInspector, TracingInspector, TracingInspectorConfig};
use alloy_primitives::{Address, Log, U256};
use alloy_rpc_types::trace::geth::{
use alloy_rpc_types_trace::geth::{
mux::{MuxConfig, MuxFrame},
CallConfig, FourByteFrame, GethDebugBuiltInTracerType, GethDebugTracerConfig, GethTrace,
NoopFrame, PreStateConfig,
Expand Down
2 changes: 1 addition & 1 deletion src/tracing/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use crate::tracing::{config::TraceStyle, utils, utils::convert_memory};
pub use alloy_primitives::Log;
use alloy_primitives::{Address, Bytes, FixedBytes, LogData, U256};
use alloy_rpc_types::trace::{
use alloy_rpc_types_trace::{
geth::{CallFrame, CallLogFrame, GethDefaultTracingOptions, StructLog},
parity::{
Action, ActionType, CallAction, CallOutput, CallType, CreateAction, CreateOutput,
Expand Down
2 changes: 1 addition & 1 deletion tests/it/geth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use crate::utils::inspect;
use alloy_primitives::{hex, Address, Bytes};
use alloy_rpc_types::trace::geth::{
use alloy_rpc_types_trace::geth::{
mux::MuxConfig, CallConfig, GethDebugBuiltInTracerType, GethDebugTracerConfig, GethTrace,
PreStateConfig,
};
Expand Down
6 changes: 2 additions & 4 deletions tests/it/parity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

use crate::utils::{inspect, print_traces};
use alloy_primitives::{address, hex, Address, U256};
use alloy_rpc_types::{
trace::parity::{Action, CallAction, CallType, SelfdestructAction, TraceType},
TransactionInfo,
};
use alloy_rpc_types_eth::TransactionInfo;
use alloy_rpc_types_trace::parity::{Action, CallAction, CallType, SelfdestructAction, TraceType};
use revm::{
db::{CacheDB, EmptyDB},
primitives::{
Expand Down

0 comments on commit 6c408ff

Please sign in to comment.