diff --git a/src/actors/monitor/txn_tracker.rs b/src/actors/monitor/txn_tracker.rs index 6b0aeee..9414488 100644 --- a/src/actors/monitor/txn_tracker.rs +++ b/src/actors/monitor/txn_tracker.rs @@ -3,7 +3,6 @@ use std::collections::{BTreeSet, HashMap, HashSet, VecDeque}; use std::sync::Arc; use std::time::{Duration, Instant}; -use alloy::consensus::Account; use alloy::primitives::TxHash; use comfy_table::{presets::UTF8_FULL, Attribute, Cell, Color, Table}; use tracing::{debug, error, warn}; @@ -338,7 +337,7 @@ impl TxnTracker { impl std::future::Future< Output = ( PendingTxInfo, - Result, + Result, Result, anyhow::Error>, ), >, @@ -378,15 +377,15 @@ impl TxnTracker { let task = async move { let result = client.get_transaction_receipt(task_info.tx_hash).await; - let account = client - .get_account(*task_info.metadata.from_account.as_ref()) + let nonce = client + .get_txn_count(*task_info.metadata.from_account.as_ref()) .await; tracing::debug!( "checked tx_hash={:?} result={:?}", task_info.tx_hash, result ); - (task_info, account, result) + (task_info, nonce, result) }; tasks.push(task); } else { @@ -401,7 +400,7 @@ impl TxnTracker { &mut self, results: Vec<( PendingTxInfo, - Result, + Result, Result, anyhow::Error>, )>, ) -> Vec { @@ -410,7 +409,7 @@ impl TxnTracker { let mut retry_queue = Vec::new(); // 1. Categorize results - for (info, account, result) in results { + for (info, nonce_result, result) in results { match result { Ok(Some(receipt)) => { // Transaction successfully confirmed @@ -419,8 +418,8 @@ impl TxnTracker { } Ok(None) => { // Transaction still pending - if let Ok(account) = account { - if account.nonce > info.metadata.nonce { + if let Ok(current_nonce) = nonce_result { + if current_nonce > info.metadata.nonce { successful_txns.push((info, true)); } } else {