diff --git a/crates/chainio/clients/avsregistry/src/writer.rs b/crates/chainio/clients/avsregistry/src/writer.rs index f8b8c9e4b..c35d0a90c 100644 --- a/crates/chainio/clients/avsregistry/src/writer.rs +++ b/crates/chainio/clients/avsregistry/src/writer.rs @@ -334,9 +334,9 @@ mod tests { use eigen_crypto_bls::BlsKeyPair; use eigen_logging::get_test_logger; use eigen_testing_utils::anvil_constants::{ - get_operator_state_retriever_address, get_registry_coordinator_address, - get_transaction_status, ANVIL_HTTP_URL, + get_operator_state_retriever_address, get_registry_coordinator_address, ANVIL_HTTP_URL, }; + use eigen_testing_utils::transaction::get_transaction_status; async fn build_avs_registry_chain_writer(private_key: String) -> AvsRegistryChainWriter { let registry_coordinator_address = get_registry_coordinator_address().await; diff --git a/crates/services/bls_aggregation/src/bls_agg_test.rs b/crates/services/bls_aggregation/src/bls_agg_test.rs index b776c6198..f91ad2640 100644 --- a/crates/services/bls_aggregation/src/bls_agg_test.rs +++ b/crates/services/bls_aggregation/src/bls_agg_test.rs @@ -16,10 +16,7 @@ pub mod integration_test { get_erc20_mock_strategy, get_operator_state_retriever_address, get_registry_coordinator_address, get_service_manager_address, }; - use eigen_types::{ - avs::TaskIndex, - operator::{operator_id_from_g1_pub_key, QuorumThresholdPercentages}, - }; + use eigen_types::{avs::TaskIndex, operator::QuorumThresholdPercentages}; use eigen_utils::{ binding::{ IBLSSignatureChecker::{self, G1Point, NonSignerStakesAndSignature}, diff --git a/testing/testing-utils/src/anvil_constants.rs b/testing/testing-utils/src/anvil_constants.rs index 17acfd35e..7d7bafbdf 100644 --- a/testing/testing-utils/src/anvil_constants.rs +++ b/testing/testing-utils/src/anvil_constants.rs @@ -1,9 +1,9 @@ //! Anvil utilities use alloy_network::Ethereum; -use alloy_primitives::{address, Address, FixedBytes}; +use alloy_primitives::{address, Address}; use alloy_provider::{ fillers::{ChainIdFiller, FillProvider, GasFiller, JoinFill, NonceFiller}, - Provider, RootProvider, + RootProvider, }; use alloy_transport_http::{Client, Http}; use eigen_utils::{ @@ -11,7 +11,6 @@ use eigen_utils::{ get_provider, }; use once_cell::sync::Lazy; -use tokio::time::{sleep, Duration}; /// Local anvil ContractsRegistry which contains a mapping of all locally deployed EL contracts. pub const CONTRACTS_REGISTRY: Address = address!("5FbDB2315678afecb367f032d93F642f64180aa3"); @@ -154,24 +153,3 @@ pub async fn get_proxy_admin() -> Address { address } - -/// Retrieves the status of a transaction from its hash. -/// -/// # Arguments -/// -/// `tx_hash` - The hash of the transaction. -/// -/// # Returns -/// -/// A bool indicating wether the transaction was successful or not. -pub async fn get_transaction_status(tx_hash: FixedBytes<32>) -> bool { - // this sleep is needed so that we wait for the tx to be processed - sleep(Duration::from_millis(500)).await; - ANVIL_RPC_URL - .clone() - .get_transaction_receipt(tx_hash) - .await - .unwrap() - .unwrap() - .status() -} diff --git a/testing/testing-utils/src/lib.rs b/testing/testing-utils/src/lib.rs index 8c158a139..dd428d3dd 100644 --- a/testing/testing-utils/src/lib.rs +++ b/testing/testing-utils/src/lib.rs @@ -14,3 +14,6 @@ pub mod m2_holesky_constants; /// Anvil constants pub mod anvil_constants; + +/// Transaction utilities for testing. +pub mod transaction; diff --git a/testing/testing-utils/src/transaction.rs b/testing/testing-utils/src/transaction.rs new file mode 100644 index 000000000..561a206b9 --- /dev/null +++ b/testing/testing-utils/src/transaction.rs @@ -0,0 +1,25 @@ +use super::anvil_constants::ANVIL_RPC_URL; +use alloy_primitives::FixedBytes; +use alloy_provider::Provider; +use tokio::time::{sleep, Duration}; + +/// Retrieves the status of a transaction from its hash. +/// +/// # Arguments +/// +/// `tx_hash` - The hash of the transaction. +/// +/// # Returns +/// +/// A bool indicating wether the transaction was successful or not. +pub async fn get_transaction_status(tx_hash: FixedBytes<32>) -> bool { + // this sleep is needed so that we wait for the tx to be processed + sleep(Duration::from_millis(500)).await; + ANVIL_RPC_URL + .clone() + .get_transaction_receipt(tx_hash) + .await + .unwrap() + .unwrap() + .status() +}