mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 02:49:55 +00:00
feat: remove transaction_to_call_request helper fn (#14089)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
@ -50,11 +50,3 @@ pub trait TransactionCompat<T = TransactionSigned>:
|
|||||||
// <https://github.com/alloy-rs/alloy/issues/1315>.
|
// <https://github.com/alloy-rs/alloy/issues/1315>.
|
||||||
fn otterscan_api_truncate_input(tx: &mut Self::Transaction);
|
fn otterscan_api_truncate_input(tx: &mut Self::Transaction);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Convert [`Recovered`] to [`TransactionRequest`]
|
|
||||||
pub fn transaction_to_call_request<T: alloy_consensus::Transaction>(
|
|
||||||
tx: Recovered<T>,
|
|
||||||
) -> TransactionRequest {
|
|
||||||
let from = tx.signer();
|
|
||||||
TransactionRequest::from_transaction_with_sender(tx.into_tx(), from)
|
|
||||||
}
|
|
||||||
|
|||||||
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
use alloy_eips::BlockNumberOrTag;
|
use alloy_eips::BlockNumberOrTag;
|
||||||
use alloy_primitives::Address;
|
use alloy_primitives::Address;
|
||||||
use alloy_rpc_types_eth::state::EvmOverrides;
|
use alloy_rpc_types_eth::{state::EvmOverrides, TransactionRequest};
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use futures_util::StreamExt;
|
use futures_util::StreamExt;
|
||||||
use reth::{
|
use reth::{
|
||||||
@ -25,7 +25,7 @@ use reth::{
|
|||||||
primitives::{Env, EnvWithHandlerCfg},
|
primitives::{Env, EnvWithHandlerCfg},
|
||||||
Database, Evm, EvmContext, Inspector,
|
Database, Evm, EvmContext, Inspector,
|
||||||
},
|
},
|
||||||
rpc::{api::eth::helpers::Call, compat::transaction::transaction_to_call_request},
|
rpc::api::eth::helpers::Call,
|
||||||
transaction_pool::TransactionPool,
|
transaction_pool::TransactionPool,
|
||||||
};
|
};
|
||||||
use reth_evm::EvmEnv;
|
use reth_evm::EvmEnv;
|
||||||
@ -57,7 +57,8 @@ fn main() {
|
|||||||
if let Some(recipient) = tx.to() {
|
if let Some(recipient) = tx.to() {
|
||||||
if args.is_match(&recipient) {
|
if args.is_match(&recipient) {
|
||||||
// convert the pool transaction
|
// convert the pool transaction
|
||||||
let call_request = transaction_to_call_request(tx.to_consensus());
|
let call_request =
|
||||||
|
TransactionRequest::from_recovered_transaction(tx.to_consensus());
|
||||||
|
|
||||||
let result = eth_api
|
let result = eth_api
|
||||||
.spawn_with_call_at(
|
.spawn_with_call_at(
|
||||||
|
|||||||
@ -16,7 +16,7 @@ use clap::Parser;
|
|||||||
use futures_util::StreamExt;
|
use futures_util::StreamExt;
|
||||||
use reth::{
|
use reth::{
|
||||||
builder::NodeHandle, chainspec::EthereumChainSpecParser, cli::Cli,
|
builder::NodeHandle, chainspec::EthereumChainSpecParser, cli::Cli,
|
||||||
rpc::compat::transaction::transaction_to_call_request, transaction_pool::TransactionPool,
|
rpc::types::TransactionRequest, transaction_pool::TransactionPool,
|
||||||
};
|
};
|
||||||
use reth_node_ethereum::node::EthereumNode;
|
use reth_node_ethereum::node::EthereumNode;
|
||||||
|
|
||||||
@ -44,7 +44,8 @@ fn main() {
|
|||||||
if let Some(recipient) = tx.to() {
|
if let Some(recipient) = tx.to() {
|
||||||
if args.is_match(&recipient) {
|
if args.is_match(&recipient) {
|
||||||
// trace the transaction with `trace_call`
|
// trace the transaction with `trace_call`
|
||||||
let callrequest = transaction_to_call_request(tx.to_consensus());
|
let callrequest =
|
||||||
|
TransactionRequest::from_recovered_transaction(tx.to_consensus());
|
||||||
let tracerequest = TraceCallRequest::new(callrequest)
|
let tracerequest = TraceCallRequest::new(callrequest)
|
||||||
.with_trace_type(TraceType::Trace);
|
.with_trace_type(TraceType::Trace);
|
||||||
if let Ok(trace_result) = traceapi.trace_call(tracerequest).await {
|
if let Ok(trace_result) = traceapi.trace_call(tracerequest).await {
|
||||||
|
|||||||
Reference in New Issue
Block a user