Added fetch_add_nonce method for NodeInteraction trait. Added extra logging. (#25)

* added logging

* added fetch_add_nonce method

* Added nonce for legacy transaction also

* Addressed PR comments
This commit is contained in:
activecoder10
2025-06-18 22:43:16 +03:00
committed by GitHub
parent e9b5a06aec
commit ee97b62e70
7 changed files with 213 additions and 19 deletions
+5
View File
@@ -1,9 +1,11 @@
//! This crate implements all node interactions.
use alloy::primitives::Address;
use alloy::rpc::types::trace::geth::{DiffMode, GethTrace};
use alloy::rpc::types::{TransactionReceipt, TransactionRequest};
use tokio_runtime::TO_TOKIO;
pub mod nonce;
mod tokio_runtime;
pub mod trace;
pub mod transaction;
@@ -21,4 +23,7 @@ pub trait EthereumNode {
/// Returns the state diff of the transaction hash in the [TransactionReceipt].
fn state_diff(&self, transaction: TransactionReceipt) -> anyhow::Result<DiffMode>;
/// Returns the next available nonce for the given [Address].
fn fetch_add_nonce(&self, address: Address) -> anyhow::Result<u64>;
}