mirror of
https://github.com/pezkuwichain/revive-differential-tests.git
synced 2026-04-28 10:47:59 +00:00
90fb89adc0
* Add a barebones common crate * Refactor some code into the common crate * Add a `ResolverApi` interface. This commit adds a `ResolverApi` trait to the `format` crate that can be implemented by any type that can act as a resolver. A resolver is able to provide information on the chain state. This chain state could be fresh or it could be cached (which is something that we will do in a future PR). This cleans up our crate graph so that `format` is not depending on the node interactions crate for the `EthereumNode` trait. * Cleanup the blocking executor
22 lines
892 B
Rust
22 lines
892 B
Rust
//! This crate implements all node interactions.
|
|
|
|
use alloy::rpc::types::trace::geth::{DiffMode, GethDebugTracingOptions, GethTrace};
|
|
use alloy::rpc::types::{TransactionReceipt, TransactionRequest};
|
|
use anyhow::Result;
|
|
|
|
/// An interface for all interactions with Ethereum compatible nodes.
|
|
pub trait EthereumNode {
|
|
/// Execute the [TransactionRequest] and return a [TransactionReceipt].
|
|
fn execute_transaction(&self, transaction: TransactionRequest) -> Result<TransactionReceipt>;
|
|
|
|
/// Trace the transaction in the [TransactionReceipt] and return a [GethTrace].
|
|
fn trace_transaction(
|
|
&self,
|
|
receipt: &TransactionReceipt,
|
|
trace_options: GethDebugTracingOptions,
|
|
) -> Result<GethTrace>;
|
|
|
|
/// Returns the state diff of the transaction hash in the [TransactionReceipt].
|
|
fn state_diff(&self, receipt: &TransactionReceipt) -> Result<DiffMode>;
|
|
}
|