mirror of
https://github.com/pezkuwichain/revive-differential-tests.git
synced 2026-05-10 01:17:58 +00:00
initialize geth via the standard json
Signed-off-by: xermicus <bigcyrill@hotmail.com>
This commit is contained in:
@@ -2,15 +2,14 @@
|
||||
|
||||
use alloy::rpc::types::trace::geth::GethTrace;
|
||||
use alloy::rpc::types::{TransactionReceipt, TransactionRequest};
|
||||
use revive_dt_node::Node;
|
||||
use tokio_runtime::TO_TOKIO;
|
||||
|
||||
mod tokio_runtime;
|
||||
pub mod trace;
|
||||
pub mod transaction;
|
||||
|
||||
/// An interface for all node interactions.
|
||||
pub trait NodeInteraction: Node {
|
||||
/// An interface for all interactions with Ethereum compatible nodes.
|
||||
pub trait EthereumNode {
|
||||
/// Execute the [TransactionRequest] and return a [TransactionReceipt].
|
||||
fn execute_transaction(
|
||||
&self,
|
||||
|
||||
@@ -5,7 +5,6 @@ use alloy::providers::ProviderBuilder;
|
||||
use alloy::providers::ext::DebugApi;
|
||||
use alloy::rpc::types::TransactionReceipt;
|
||||
use alloy::rpc::types::trace::geth::{GethDebugTracingOptions, GethTrace};
|
||||
use revive_dt_node::Node;
|
||||
use tokio::sync::mpsc;
|
||||
|
||||
use crate::TO_TOKIO;
|
||||
@@ -37,10 +36,10 @@ impl AsyncNodeInteraction for Trace {
|
||||
|
||||
/// Trace the transaction in [TransactionReceipt] against the `node`,
|
||||
/// using the provided [GethDebugTracingOptions].
|
||||
pub fn trace_transaction<T: Node>(
|
||||
pub fn trace_transaction(
|
||||
transaction_receipt: TransactionReceipt,
|
||||
options: GethDebugTracingOptions,
|
||||
node: &T,
|
||||
connection_string: String,
|
||||
) -> anyhow::Result<GethTrace> {
|
||||
let trace_sender = TO_TOKIO.lock().unwrap().trace_sender.clone();
|
||||
let (geth_trace_sender, mut geth_trace_receiver) = mpsc::channel(1);
|
||||
@@ -49,7 +48,7 @@ pub fn trace_transaction<T: Node>(
|
||||
transaction_hash: transaction_receipt.transaction_hash,
|
||||
options,
|
||||
geth_trace_sender,
|
||||
connection_string: node.connection_string(),
|
||||
connection_string,
|
||||
})?;
|
||||
|
||||
geth_trace_receiver
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
use alloy::providers::{Provider, ProviderBuilder};
|
||||
use alloy::rpc::types::{TransactionReceipt, TransactionRequest};
|
||||
use revive_dt_node::Node;
|
||||
use tokio::sync::mpsc;
|
||||
|
||||
use crate::TO_TOKIO;
|
||||
@@ -34,9 +33,9 @@ impl AsyncNodeInteraction for Transaction {
|
||||
}
|
||||
|
||||
/// Execute the [TransactionRequest] against the `node`.
|
||||
pub fn execute_transaction<T: Node>(
|
||||
pub fn execute_transaction(
|
||||
transaction_request: TransactionRequest,
|
||||
node: &T,
|
||||
connection_string: String,
|
||||
) -> anyhow::Result<TransactionReceipt> {
|
||||
let request_sender = TO_TOKIO.lock().unwrap().transaction_sender.clone();
|
||||
let (receipt_sender, mut receipt_receiver) = mpsc::channel(1);
|
||||
@@ -44,7 +43,7 @@ pub fn execute_transaction<T: Node>(
|
||||
request_sender.blocking_send(Transaction {
|
||||
transaction_request,
|
||||
receipt_sender,
|
||||
connection_string: node.connection_string(),
|
||||
connection_string,
|
||||
})?;
|
||||
|
||||
receipt_receiver
|
||||
|
||||
Reference in New Issue
Block a user