diff --git a/justfile b/justfile index 000051aa1..0287f563e 100644 --- a/justfile +++ b/justfile @@ -70,7 +70,10 @@ test-all: test-integration: @echo 'NOTE that demo-native must be running for this test to succeed.' - cargo nextest run --all-features --nocapture --profile integration + INTEGRATION_TEST_SEQUENCER_VERSION=2 cargo nextest run --all-features --nocapture --profile integration smoke +test-integration-mp: + @echo 'NOTE that demo-native-mp must be running for this test to succeed.' + INTEGRATION_TEST_SEQUENCER_VERSION=99 cargo nextest run --all-features --nocapture --profile integration clippy: @echo 'features: "embedded-db"' diff --git a/sequencer-sqlite/Cargo.lock b/sequencer-sqlite/Cargo.lock index 663dd21b5..95cf3cc22 100644 --- a/sequencer-sqlite/Cargo.lock +++ b/sequencer-sqlite/Cargo.lock @@ -4090,7 +4090,7 @@ dependencies = [ [[package]] name = "hotshot-query-service" version = "0.1.75" -source = "git+https://github.com/EspressoSystems/hotshot-query-service?tag=v0.1.75#dffefa160f441a663723a67bc54efedb11a88b02" +source = "git+https://github.com/EspressoSystems/hotshot-query-service?tag=v0.1.75-explorer-fixes#d36941606c1a7a9a488963f05e96515fa9cbc1c7" dependencies = [ "anyhow", "ark-serialize", @@ -4113,6 +4113,7 @@ dependencies = [ "itertools 0.12.1", "jf-merkle-tree", "jf-vid", + "lazy_static", "log", "prometheus", "refinery", diff --git a/tests/common/mod.rs b/tests/common/mod.rs index 52afd6496..ea0d75069 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -1,11 +1,12 @@ use anyhow::{anyhow, Result}; use client::SequencerClient; -use espresso_types::FeeAmount; +use espresso_types::{FeeAmount, MarketplaceVersion}; use ethers::prelude::*; use futures::future::join_all; use std::{fmt, str::FromStr, time::Duration}; use surf_disco::Url; use tokio::time::{sleep, timeout}; +use vbs::version::StaticVersionType; const L1_PROVIDER_RETRY_INTERVAL: Duration = Duration::from_secs(1); // TODO add to .env @@ -93,17 +94,18 @@ impl TestConfig { }; // TODO test both builders (probably requires some refactoring). - let builder_url = if sequencer_version >= 3 { + let builder_url = if sequencer_version as u16 >= MarketplaceVersion::version().minor { let url = url_from_port(dotenvy::var("ESPRESSO_RESERVE_BUILDER_SERVER_PORT")?)?; + let url = Url::from_str(&url)?; + wait_for_service(url.clone(), 1000, 200).await.unwrap(); - Url::from_str(&url)? - .join("bundle_info/builderaddress") - .unwrap() + url.join("bundle_info/builderaddress").unwrap() } else { let url = url_from_port(dotenvy::var("ESPRESSO_BUILDER_SERVER_PORT")?)?; - Url::from_str(&url)? - .join("block_info/builderaddress") - .unwrap() + let url = Url::from_str(&url)?; + wait_for_service(url.clone(), 1000, 200).await.unwrap(); + + url.join("block_info/builderaddress").unwrap() }; let builder_address = get_builder_address(builder_url).await; @@ -222,9 +224,8 @@ impl TestConfig { } } -/// Get Address from builder after waiting for builder to become ready. +/// Get Address from builder pub async fn get_builder_address(url: Url) -> Address { - let _ = wait_for_service(url.clone(), 1000, 200).await; for _ in 0..5 { // Try to get builder address somehow if let Ok(body) = reqwest::get(url.clone()).await { diff --git a/tests/upgrades.rs b/tests/upgrades.rs index 5d6893844..e680d904b 100644 --- a/tests/upgrades.rs +++ b/tests/upgrades.rs @@ -12,7 +12,7 @@ async fn test_upgrade() -> Result<()> { let testing = TestConfig::new().await.unwrap(); - let versions = if testing.sequencer_version >= 3 { + let versions = if testing.sequencer_version as u16 >= MarketplaceVersion::version().minor { (FeeVersion::version(), MarketplaceVersion::version()) } else { panic!("Invalid sequencer version provided for upgrade test.");