From 9181fa96b116788e9a6360755413a2ea42dfd87d Mon Sep 17 00:00:00 2001 From: Kolby Moroz Liebl <31669092+KolbyML@users.noreply.github.com> Date: Fri, 21 Jun 2024 22:09:14 +0900 Subject: [PATCH] simulators/portal: update simulators to use updated hivesim-rs with sim.limit support --- simulators/portal/beacon/Cargo.toml | 2 +- simulators/portal/beacon/src/main.rs | 17 +---------------- simulators/portal/history/Cargo.toml | 2 +- simulators/portal/history/src/main.rs | 17 +---------------- simulators/portal/state/Cargo.toml | 2 +- simulators/portal/state/src/main.rs | 17 +---------------- 6 files changed, 6 insertions(+), 51 deletions(-) diff --git a/simulators/portal/beacon/Cargo.toml b/simulators/portal/beacon/Cargo.toml index c6e5f9b628..e3c9acc14e 100755 --- a/simulators/portal/beacon/Cargo.toml +++ b/simulators/portal/beacon/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" [dependencies] ethportal-api = { git = "https://github.com/ethereum/trin", rev = "33ea99da64216899f7ab2778d117a18506d963dd" } -hivesim = { git = "https://github.com/ethereum/portal-hive", rev = "0f830ea8999f2878eb78ef67efc9f80cc888413e" } +hivesim = { git = "https://github.com/ethereum/hive", rev = "62b3362bae655754b5f624c36720ba8c44a2f375" } futures = "0.3.25" itertools = "0.10.5" serde_yaml = "0.9" diff --git a/simulators/portal/beacon/src/main.rs b/simulators/portal/beacon/src/main.rs index 9b80ba675c..9f5ad2aea2 100644 --- a/simulators/portal/beacon/src/main.rs +++ b/simulators/portal/beacon/src/main.rs @@ -1,6 +1,6 @@ mod suites; -use hivesim::{Simulation, Suite, TestSpec}; +use hivesim::{run_suite, Simulation, Suite, TestSpec}; use suites::interop::test_portal_interop; use suites::mesh::test_portal_scenarios; use suites::rpc_compat::run_rpc_compat_test_suite; @@ -60,18 +60,3 @@ async fn main() { let sim = Simulation::new(); run_suite(sim, vec![beacon_rpc_compat, interop, mesh]).await; } - -async fn run_suite(host: Simulation, suites: Vec) { - for suite in suites { - let name = suite.clone().name; - let description = suite.clone().description; - - let suite_id = host.start_suite(name, description, "".to_string()).await; - - for test in &suite.tests { - test.run_test(host.clone(), suite_id, suite.clone()).await; - } - - host.end_suite(suite_id).await; - } -} diff --git a/simulators/portal/history/Cargo.toml b/simulators/portal/history/Cargo.toml index 766b690659..d0ceda4cb8 100755 --- a/simulators/portal/history/Cargo.toml +++ b/simulators/portal/history/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [dependencies] ethportal-api = { git = "https://github.com/ethereum/trin", rev = "33ea99da64216899f7ab2778d117a18506d963dd" } portal-spec-test-utils-rs = { git = "https://github.com/ethereum/portal-spec-tests", rev = "954f7d0eb2950a2131048404a1a4ce476bb64657" } -hivesim = { git = "https://github.com/ethereum/portal-hive", rev = "0f830ea8999f2878eb78ef67efc9f80cc888413e" } +hivesim = { git = "https://github.com/ethereum/hive", rev = "62b3362bae655754b5f624c36720ba8c44a2f375" } futures = "0.3.25" serde_json = "1.0.87" tracing = "0.1.37" diff --git a/simulators/portal/history/src/main.rs b/simulators/portal/history/src/main.rs index 39216444fa..188b9339b3 100644 --- a/simulators/portal/history/src/main.rs +++ b/simulators/portal/history/src/main.rs @@ -1,6 +1,6 @@ pub mod suites; -use hivesim::{Simulation, Suite, TestSpec}; +use hivesim::{run_suite, Simulation, Suite, TestSpec}; use suites::interop::test_portal_interop; use suites::mesh::test_portal_scenarios; use suites::rpc_compat::run_rpc_compat_test_suite; @@ -75,18 +75,3 @@ async fn main() { let sim = Simulation::new(); run_suite(sim, vec![rpc_compat, interop, mesh, trin_bridge]).await; } - -async fn run_suite(host: Simulation, suites: Vec) { - for suite in suites { - let name = suite.clone().name; - let description = suite.clone().description; - - let suite_id = host.start_suite(name, description, "".to_string()).await; - - for test in &suite.tests { - test.run_test(host.clone(), suite_id, suite.clone()).await; - } - - host.end_suite(suite_id).await; - } -} diff --git a/simulators/portal/state/Cargo.toml b/simulators/portal/state/Cargo.toml index 745dab2ee6..a6c53d8a6c 100755 --- a/simulators/portal/state/Cargo.toml +++ b/simulators/portal/state/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" [dependencies] ethportal-api = { git = "https://github.com/ethereum/trin", rev = "33ea99da64216899f7ab2778d117a18506d963dd" } -hivesim = { git = "https://github.com/ethereum/portal-hive", rev = "0f830ea8999f2878eb78ef67efc9f80cc888413e" } +hivesim = { git = "https://github.com/ethereum/hive", rev = "62b3362bae655754b5f624c36720ba8c44a2f375" } futures = "0.3.25" itertools = "0.10.5" serde_json = "1.0.87" diff --git a/simulators/portal/state/src/main.rs b/simulators/portal/state/src/main.rs index ef286b1623..14a0bb2ce1 100644 --- a/simulators/portal/state/src/main.rs +++ b/simulators/portal/state/src/main.rs @@ -1,6 +1,6 @@ mod suites; -use hivesim::{Simulation, Suite, TestSpec}; +use hivesim::{run_suite, Simulation, Suite, TestSpec}; use suites::interop::test_portal_interop; use suites::rpc_compat::run_rpc_compat_test_suite; @@ -44,18 +44,3 @@ async fn main() { let sim = Simulation::new(); run_suite(sim, vec![state_rpc_compat, interop]).await; } - -async fn run_suite(host: Simulation, suites: Vec) { - for suite in suites { - let name = suite.clone().name; - let description = suite.clone().description; - - let suite_id = host.start_suite(name, description, "".to_string()).await; - - for test in &suite.tests { - test.run_test(host.clone(), suite_id, suite.clone()).await; - } - - host.end_suite(suite_id).await; - } -}