Skip to content

Commit

Permalink
fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
tcoratger committed Sep 21, 2024
1 parent 0182532 commit 63ac065
Show file tree
Hide file tree
Showing 17 changed files with 64 additions and 72 deletions.
4 changes: 4 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions crates/rpc/rpc-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ alloy-eips.workspace = true
alloy-json-rpc.workspace = true
alloy-primitives.workspace = true
alloy-rpc-types-eth.workspace = true
alloy-rpc-types-trace.workspace = true

# misc
jsonrpsee = { workspace = true, features = ["server", "macros"] }
Expand Down
12 changes: 4 additions & 8 deletions crates/rpc/rpc-api/src/debug.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
use alloy_primitives::{Address, Bytes, B256};
use alloy_rpc_types_eth::transaction::TransactionRequest;
use alloy_rpc_types_trace::geth::{
BlockTraceResult, GethDebugTracingCallOptions, GethDebugTracingOptions, GethTrace, TraceResult,
};
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
use reth_primitives::{BlockId, BlockNumberOrTag};
use reth_rpc_types::{
debug::ExecutionWitness,
trace::geth::{
BlockTraceResult, GethDebugTracingCallOptions, GethDebugTracingOptions, GethTrace,
TraceResult,
},
Block, Bundle, StateContext,
};
use reth_rpc_types::{debug::ExecutionWitness, Block, Bundle, StateContext};

/// Debug rpc interface.
#[cfg_attr(not(feature = "client"), rpc(server, namespace = "debug"))]
Expand Down
12 changes: 5 additions & 7 deletions crates/rpc/rpc-api/src/otterscan.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
use alloy_json_rpc::RpcObject;
use alloy_primitives::{Address, Bytes, TxHash, B256};
use alloy_rpc_types_trace::otterscan::{
BlockDetails, ContractCreator, InternalOperation, OtsBlockTransactions, TraceEntry,
TransactionsWithReceipts,
};
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
use reth_primitives::BlockId;
use reth_rpc_types::{
trace::otterscan::{
BlockDetails, ContractCreator, InternalOperation, OtsBlockTransactions, TraceEntry,
TransactionsWithReceipts,
},
Header,
};
use reth_rpc_types::Header;

/// Otterscan rpc interface.
#[cfg_attr(not(feature = "client"), rpc(server, namespace = "ots"))]
Expand Down
15 changes: 6 additions & 9 deletions crates/rpc/rpc-api/src/trace.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
use alloy_primitives::{Bytes, B256};
use alloy_rpc_types_eth::transaction::TransactionRequest;
use alloy_rpc_types_trace::{
filter::TraceFilter,
opcode::{BlockOpcodeGas, TransactionOpcodeGas},
parity::*,
};
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
use reth_primitives::BlockId;
use reth_rpc_types::{
state::StateOverride,
trace::{
filter::TraceFilter,
opcode::{BlockOpcodeGas, TransactionOpcodeGas},
parity::*,
},
BlockOverrides, Index,
};
use reth_rpc_types::{state::StateOverride, BlockOverrides, Index};
use std::collections::HashSet;

/// Ethereum trace API
Expand Down
1 change: 1 addition & 0 deletions crates/rpc/rpc-builder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ reth-rpc-types-compat.workspace = true

alloy-primitives.workspace = true
alloy-rpc-types-eth.workspace = true
alloy-rpc-types-trace.workspace = true

tokio = { workspace = true, features = ["rt", "rt-multi-thread"] }
serde_json.workspace = true
Expand Down
5 changes: 3 additions & 2 deletions crates/rpc/rpc-builder/tests/it/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
use crate::utils::{launch_http, launch_http_ws, launch_ws};
use alloy_primitives::{hex_literal::hex, Address, Bytes, TxHash, B256, B64, U256, U64};
use alloy_rpc_types_eth::transaction::TransactionRequest;
use alloy_rpc_types_trace::filter::TraceFilter;
use jsonrpsee::{
core::{
client::{ClientT, SubscriptionClientT},
Expand All @@ -22,8 +23,8 @@ use reth_rpc_api::{
};
use reth_rpc_server_types::RethRpcModule;
use reth_rpc_types::{
trace::filter::TraceFilter, Block, FeeHistory, Filter, Index, Log,
PendingTransactionFilterKind, SyncStatus, Transaction, TransactionReceipt,
Block, FeeHistory, Filter, Index, Log, PendingTransactionFilterKind, SyncStatus, Transaction,
TransactionReceipt,
};
use serde::{de::DeserializeOwned, Deserialize, Serialize};
use serde_json::Value;
Expand Down
1 change: 1 addition & 0 deletions crates/rpc/rpc-testing-util/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ reth-rpc-api = { workspace = true, features = ["client"] }
# ethereum
alloy-primitives.workspace = true
alloy-rpc-types-eth.workspace = true
alloy-rpc-types-trace.workspace = true

# async
futures.workspace = true
Expand Down
12 changes: 5 additions & 7 deletions crates/rpc/rpc-testing-util/src/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,15 @@ use std::{

use alloy_primitives::{TxHash, B256};
use alloy_rpc_types_eth::transaction::TransactionRequest;
use alloy_rpc_types_trace::{
common::TraceResult,
geth::{GethDebugTracerType, GethDebugTracingOptions, GethTrace},
};
use futures::{Stream, StreamExt};
use jsonrpsee::core::client::Error as RpcError;
use reth_primitives::{BlockId, Receipt};
use reth_rpc_api::{clients::DebugApiClient, EthApiClient};
use reth_rpc_types::{
trace::{
common::TraceResult,
geth::{GethDebugTracerType, GethDebugTracingOptions, GethTrace},
},
Block, Transaction,
};
use reth_rpc_types::{Block, Transaction};

const NOOP_TRACER: &str = include_str!("../assets/noop-tracer.js");
const JS_TRACER_TEMPLATE: &str = include_str!("../assets/tracer-template.js");
Expand Down
14 changes: 6 additions & 8 deletions crates/rpc/rpc-testing-util/src/trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,16 @@

use alloy_primitives::{Bytes, TxHash, B256};
use alloy_rpc_types_eth::transaction::TransactionRequest;
use alloy_rpc_types_trace::{
filter::TraceFilter,
parity::{LocalizedTransactionTrace, TraceResults, TraceType},
tracerequest::TraceCallRequest,
};
use futures::{Stream, StreamExt};
use jsonrpsee::core::client::Error as RpcError;
use reth_primitives::BlockId;
use reth_rpc_api::clients::TraceApiClient;
use reth_rpc_types::{
trace::{
filter::TraceFilter,
parity::{LocalizedTransactionTrace, TraceResults, TraceType},
tracerequest::TraceCallRequest,
},
Index,
};
use reth_rpc_types::Index;
use std::{
collections::HashSet,
pin::Pin,
Expand Down
8 changes: 4 additions & 4 deletions crates/rpc/rpc-testing-util/tests/it/trace.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
//! Integration tests for the trace API.

use alloy_rpc_types_trace::{
filter::TraceFilter, parity::TraceType, tracerequest::TraceCallRequest,
};
use futures::StreamExt;
use jsonrpsee::http_client::HttpClientBuilder;
use jsonrpsee_http_client::HttpClient;
use reth_primitives::Receipt;
use reth_rpc_api_testing_util::{debug::DebugApiExt, trace::TraceApiExt, utils::parse_env_url};
use reth_rpc_eth_api::EthApiClient;
use reth_rpc_types::{
trace::{filter::TraceFilter, parity::TraceType, tracerequest::TraceCallRequest},
Block, Transaction,
};
use reth_rpc_types::{Block, Transaction};
use std::{collections::HashSet, time::Instant};

/// This is intended to be run locally against a running node.
Expand Down
1 change: 1 addition & 0 deletions crates/rpc/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ alloy-network.workspace = true
alloy-primitives.workspace = true
alloy-rlp.workspace = true
alloy-rpc-types-eth.workspace = true
alloy-rpc-types-trace.workspace = true
revm = { workspace = true, features = [
"optional_block_gas_limit",
"optional_eip3607",
Expand Down
13 changes: 6 additions & 7 deletions crates/rpc/rpc/src/debug.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
use alloy_primitives::{Address, Bytes, B256, U256};
use alloy_rlp::{Decodable, Encodable};
use alloy_rpc_types_eth::transaction::TransactionRequest;
use alloy_rpc_types_trace::geth::{
BlockTraceResult, FourByteFrame, GethDebugBuiltInTracerType, GethDebugTracerType,
GethDebugTracingCallOptions, GethDebugTracingOptions, GethTrace, NoopFrame, TraceResult,
};
use async_trait::async_trait;
use jsonrpsee::core::RpcResult;
use reth_chainspec::{ChainSpec, EthereumHardforks};
Expand All @@ -22,13 +26,8 @@ use reth_rpc_eth_api::{
use reth_rpc_eth_types::{EthApiError, StateCacheDb};
use reth_rpc_server_types::{result::internal_rpc_err, ToRpcResult};
use reth_rpc_types::{
debug::ExecutionWitness,
state::EvmOverrides,
trace::geth::{
BlockTraceResult, FourByteFrame, GethDebugBuiltInTracerType, GethDebugTracerType,
GethDebugTracingCallOptions, GethDebugTracingOptions, GethTrace, NoopFrame, TraceResult,
},
Block as RpcBlock, BlockError, Bundle, StateContext,
debug::ExecutionWitness, state::EvmOverrides, Block as RpcBlock, BlockError, Bundle,
StateContext,
};
use reth_tasks::pool::BlockingTaskGuard;
use reth_trie::{HashedPostState, HashedStorage};
Expand Down
18 changes: 8 additions & 10 deletions crates/rpc/rpc/src/otterscan.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
use alloy_network::{ReceiptResponse, TransactionResponse};
use alloy_primitives::{Address, Bytes, TxHash, B256, U256};
use alloy_rpc_types_trace::{
otterscan::{
BlockDetails, ContractCreator, InternalOperation, OperationType, OtsBlockTransactions,
OtsReceipt, OtsTransactionReceipt, TraceEntry, TransactionsWithReceipts,
},
parity::{Action, CreateAction, CreateOutput, TraceOutput},
};
use async_trait::async_trait;
use jsonrpsee::{core::RpcResult, types::ErrorObjectOwned};
use reth_primitives::{BlockId, BlockNumberOrTag};
Expand All @@ -10,16 +17,7 @@ use reth_rpc_eth_api::{
};
use reth_rpc_eth_types::{utils::binary_search, EthApiError};
use reth_rpc_server_types::result::internal_rpc_err;
use reth_rpc_types::{
trace::{
otterscan::{
BlockDetails, ContractCreator, InternalOperation, OperationType, OtsBlockTransactions,
OtsReceipt, OtsTransactionReceipt, TraceEntry, TransactionsWithReceipts,
},
parity::{Action, CreateAction, CreateOutput, TraceOutput},
},
BlockTransactions, Header, TransactionReceipt,
};
use reth_rpc_types::{BlockTransactions, Header, TransactionReceipt};
use revm_inspectors::{
tracing::{types::CallTraceNode, TracingInspectorConfig},
transfer::{TransferInspector, TransferKind},
Expand Down
12 changes: 6 additions & 6 deletions crates/rpc/rpc/src/trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ use std::{collections::HashSet, sync::Arc};

use alloy_primitives::{Bytes, B256, U256};
use alloy_rpc_types_eth::transaction::TransactionRequest;
use alloy_rpc_types_trace::{
filter::TraceFilter,
opcode::{BlockOpcodeGas, TransactionOpcodeGas},
parity::*,
tracerequest::TraceCallRequest,
};
use async_trait::async_trait;
use jsonrpsee::core::RpcResult;
use reth_chainspec::{ChainSpec, EthereumHardforks};
Expand All @@ -20,12 +26,6 @@ use reth_rpc_eth_api::{
use reth_rpc_eth_types::{error::EthApiError, utils::recover_raw_transaction};
use reth_rpc_types::{
state::{EvmOverrides, StateOverride},
trace::{
filter::TraceFilter,
opcode::{BlockOpcodeGas, TransactionOpcodeGas},
parity::*,
tracerequest::TraceCallRequest,
},
BlockOverrides, Index,
};
use reth_tasks::pool::BlockingTaskGuard;
Expand Down
1 change: 1 addition & 0 deletions examples/txpool-tracing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ license.workspace = true
[dependencies]
reth.workspace = true
reth-node-ethereum.workspace = true
alloy-rpc-types-trace.workspace = true
clap = { workspace = true, features = ["derive"] }
futures-util.workspace = true
6 changes: 2 additions & 4 deletions examples/txpool-tracing/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,15 @@

#![cfg_attr(not(test), warn(unused_crate_dependencies))]

use alloy_rpc_types_trace::{parity::TraceType, tracerequest::TraceCallRequest};
use clap::Parser;
use futures_util::StreamExt;
use reth::{
args::utils::DefaultChainSpecParser,
builder::NodeHandle,
cli::Cli,
primitives::{Address, IntoRecoveredTransaction},
rpc::{
compat::transaction::transaction_to_call_request,
types::trace::{parity::TraceType, tracerequest::TraceCallRequest},
},
rpc::compat::transaction::transaction_to_call_request,
transaction_pool::TransactionPool,
};
use reth_node_ethereum::node::EthereumNode;
Expand Down

0 comments on commit 63ac065

Please sign in to comment.