From 26a21e799fde66c2192007fface61c10dc0a8958 Mon Sep 17 00:00:00 2001 From: ManojJiSharma Date: Mon, 23 Sep 2024 12:12:31 +0530 Subject: [PATCH] updated utils name --- Cargo.lock | 20 +++++++++---------- Cargo.toml | 2 +- chains/avalanche/Cargo.toml | 2 +- chains/avalanche/src/lib.rs | 2 +- chains/binance/Cargo.toml | 2 +- chains/binance/src/lib.rs | 2 +- .../rosetta-testing-polygon/Cargo.toml | 2 +- .../rosetta-testing-polygon/src/lib.rs | 2 +- .../Cargo.toml | 2 +- .../src/lib.rs | 2 +- 10 files changed, 19 insertions(+), 19 deletions(-) rename chains/{utils => rosetta-chain-testing}/Cargo.toml (89%) rename chains/{utils => rosetta-chain-testing}/src/lib.rs (91%) diff --git a/Cargo.lock b/Cargo.lock index 791d7acf..035b00ee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5579,6 +5579,13 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "rosetta-chain-testing" +version = "0.1.0" +dependencies = [ + "tokio", +] + [[package]] name = "rosetta-client" version = "0.6.0" @@ -5897,6 +5904,7 @@ dependencies = [ "ethers-solc", "hex-literal", "rand_core 0.6.4", + "rosetta-chain-testing", "rosetta-client", "rosetta-config-ethereum", "rosetta-core", @@ -5907,7 +5915,6 @@ dependencies = [ "tokio", "tracing", "url", - "utils", ] [[package]] @@ -5919,13 +5926,13 @@ dependencies = [ "ethers", "ethers-solc", "hex-literal", + "rosetta-chain-testing", "rosetta-client", "rosetta-config-ethereum", "rosetta-core", "rosetta-server-ethereum", "sha3", "tokio", - "utils", ] [[package]] @@ -5937,13 +5944,13 @@ dependencies = [ "ethers", "ethers-solc", "hex-literal", + "rosetta-chain-testing", "rosetta-client", "rosetta-config-ethereum", "rosetta-core", "rosetta-server-ethereum", "sha3", "tokio", - "utils", ] [[package]] @@ -8645,13 +8652,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "utils" -version = "0.1.0" -dependencies = [ - "tokio", -] - [[package]] name = "uuid" version = "0.8.2" diff --git a/Cargo.toml b/Cargo.toml index 19fc81c0..fba29034 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ members = [ "chains/polygon/rosetta-testing-polygon", "chains/binance", "chains/avalanche", - "chains/utils", + "chains/rosetta-chain-testing", ] resolver = "2" diff --git a/chains/avalanche/Cargo.toml b/chains/avalanche/Cargo.toml index 232f13cf..efebd629 100644 --- a/chains/avalanche/Cargo.toml +++ b/chains/avalanche/Cargo.toml @@ -13,6 +13,7 @@ ethers = { version = "2.0", default-features = true, features = ["abigen", "rust ethers-solc = "2.0" hex-literal = "0.4" rand_core = { version = "0.6", features = ["getrandom"] } +rosetta-chain-testing = { path = "../rosetta-chain-testing" } rosetta-client.workspace = true rosetta-config-ethereum.workspace = true rosetta-core.workspace = true @@ -22,7 +23,6 @@ sha3 = "0.10" tokio = { workspace = true, features = ["rt-multi-thread", "macros"] } tracing = "0.1.40" url = "2.4" -utils = { path = "../utils" } [dev-dependencies] serial_test = "3.1.1" diff --git a/chains/avalanche/src/lib.rs b/chains/avalanche/src/lib.rs index 9e0955f1..c316c3c9 100644 --- a/chains/avalanche/src/lib.rs +++ b/chains/avalanche/src/lib.rs @@ -44,6 +44,7 @@ mod tests { use ethers::types::H256; use ethers_solc::{artifacts::Source, CompilerInput, EvmVersion, Solc}; use hex_literal::hex; + use rosetta_chain_testing::run_test; use rosetta_client::Wallet; use rosetta_config_ethereum::{AtBlock, CallResult}; use rosetta_core::BlockchainClient; @@ -51,7 +52,6 @@ mod tests { use serial_test::serial; use sha3::Digest; use std::{collections::BTreeMap, path::Path}; - use utils::run_test; /// Account used to fund other testing accounts. const FUNDING_ACCOUNT_PRIVATE_KEY: [u8; 32] = diff --git a/chains/binance/Cargo.toml b/chains/binance/Cargo.toml index b2f58f87..e252ef8d 100644 --- a/chains/binance/Cargo.toml +++ b/chains/binance/Cargo.toml @@ -12,10 +12,10 @@ anyhow = "1.0" ethers = { version = "2.0", default-features = true, features = ["abigen", "rustls", "ws"] } ethers-solc = "2.0" hex-literal = "0.4" +rosetta-chain-testing = { path = "../rosetta-chain-testing" } rosetta-client.workspace = true rosetta-config-ethereum.workspace = true rosetta-core.workspace = true rosetta-server-ethereum.workspace = true sha3 = "0.10" tokio = { workspace = true, features = ["rt-multi-thread", "macros"] } -utils = { path = "../utils" } diff --git a/chains/binance/src/lib.rs b/chains/binance/src/lib.rs index 438f40b0..149a7d59 100644 --- a/chains/binance/src/lib.rs +++ b/chains/binance/src/lib.rs @@ -43,13 +43,13 @@ mod tests { use ethers_solc::{artifacts::Source, CompilerInput, EvmVersion, Solc}; use hex_literal::hex; + use rosetta_chain_testing::run_test; use rosetta_client::Wallet; use rosetta_config_ethereum::{AtBlock, CallResult}; use rosetta_core::BlockchainClient; use rosetta_server_ethereum::MaybeWsEthereumClient; use sha3::Digest; use std::{collections::BTreeMap, path::Path}; - use utils::run_test; /// Binance rpc url const BINANCE_RPC_WS_URL: &str = "ws://127.0.0.1:8546"; diff --git a/chains/polygon/rosetta-testing-polygon/Cargo.toml b/chains/polygon/rosetta-testing-polygon/Cargo.toml index 84847779..d66824b6 100644 --- a/chains/polygon/rosetta-testing-polygon/Cargo.toml +++ b/chains/polygon/rosetta-testing-polygon/Cargo.toml @@ -12,10 +12,10 @@ anyhow = "1.0" ethers = { version = "2.0", default-features = true, features = ["abigen", "rustls", "ws"] } ethers-solc = "2.0" hex-literal = "0.4" +rosetta-chain-testing = { path = "../../rosetta-chain-testing" } rosetta-client.workspace = true rosetta-config-ethereum.workspace = true rosetta-core.workspace = true rosetta-server-ethereum.workspace = true sha3 = "0.10" tokio = { workspace = true, features = ["rt-multi-thread", "macros"] } -utils = { path = "../../utils" } diff --git a/chains/polygon/rosetta-testing-polygon/src/lib.rs b/chains/polygon/rosetta-testing-polygon/src/lib.rs index 9c1046cf..0c8b5097 100644 --- a/chains/polygon/rosetta-testing-polygon/src/lib.rs +++ b/chains/polygon/rosetta-testing-polygon/src/lib.rs @@ -43,13 +43,13 @@ mod tests { use ethers_solc::{artifacts::Source, CompilerInput, EvmVersion, Solc}; use hex_literal::hex; + use rosetta_chain_testing::run_test; use rosetta_client::Wallet; use rosetta_config_ethereum::{AtBlock, CallResult}; use rosetta_core::BlockchainClient; use rosetta_server_ethereum::MaybeWsEthereumClient; use sha3::Digest; use std::{collections::BTreeMap, path::Path}; - use utils::run_test; /// Polygon rpc url const POLYGON_RPC_WS_URL: &str = "ws://127.0.0.1:8546"; diff --git a/chains/utils/Cargo.toml b/chains/rosetta-chain-testing/Cargo.toml similarity index 89% rename from chains/utils/Cargo.toml rename to chains/rosetta-chain-testing/Cargo.toml index 84fa5a04..7d9963aa 100644 --- a/chains/utils/Cargo.toml +++ b/chains/rosetta-chain-testing/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "utils" +name = "rosetta-chain-testing" version = "0.1.0" edition = "2021" license = "MIT" diff --git a/chains/utils/src/lib.rs b/chains/rosetta-chain-testing/src/lib.rs similarity index 91% rename from chains/utils/src/lib.rs rename to chains/rosetta-chain-testing/src/lib.rs index ab03aaba..de5be757 100644 --- a/chains/utils/src/lib.rs +++ b/chains/rosetta-chain-testing/src/lib.rs @@ -1,6 +1,6 @@ use std::future::Future; -/// Run the test in another thread while sending txs to force binance to mine new blocks +/// Run the test in another thread while sending txs /// # Panic /// Panics if the future panics pub async fn run_test + Send + 'static>(future: Fut) {