From 9aaa1c06603a0c2366c8386cc8336329a86f1ea7 Mon Sep 17 00:00:00 2001 From: Heemank Verma Date: Sat, 27 Jul 2024 16:43:11 +0530 Subject: [PATCH] update: draft #1 all da-tests running --- Cargo.lock | 23 +++++++++++++++++++ crates/orchestrator/Cargo.toml | 1 + crates/orchestrator/src/jobs/da_job/mod.rs | 1 + .../orchestrator/src/tests/jobs/da_job/mod.rs | 3 ++- 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 57c82755..b8d0687c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6311,6 +6311,7 @@ dependencies = [ "rstest 0.18.2", "serde", "serde_json", + "serial_test", "settlement-client-interface", "sharp-service", "snos", @@ -8157,6 +8158,28 @@ dependencies = [ "unsafe-libyaml", ] +[[package]] +name = "serial_test" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0bccbcf40c8938196944a3da0e133e031a33f4d6b72db3bda3cc556e361905d" +dependencies = [ + "lazy_static", + "parking_lot 0.11.2", + "serial_test_derive", +] + +[[package]] +name = "serial_test_derive" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2acd6defeddb41eb60bb468f8825d0cfd0c2a76bc03bfd235b6a1dc4f6a1ad5" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "settlement-client-interface" version = "0.1.0" diff --git a/crates/orchestrator/Cargo.toml b/crates/orchestrator/Cargo.toml index 6ca4c43f..50ba2808 100644 --- a/crates/orchestrator/Cargo.toml +++ b/crates/orchestrator/Cargo.toml @@ -66,6 +66,7 @@ with_mongodb = ["mongodb"] with_sqs = ["omniqueue"] [dev-dependencies] +serial_test = "0.5" hyper = { version = "0.14", features = ["full"] } rstest = { workspace = true } httpmock = { workspace = true, features = ["remote"] } diff --git a/crates/orchestrator/src/jobs/da_job/mod.rs b/crates/orchestrator/src/jobs/da_job/mod.rs index c73b251a..8c60c657 100644 --- a/crates/orchestrator/src/jobs/da_job/mod.rs +++ b/crates/orchestrator/src/jobs/da_job/mod.rs @@ -63,6 +63,7 @@ impl Job for DaJob { async fn process_job(&self, config: &Config, job: &mut JobItem) -> Result { let block_no = job.internal_id.parse::()?; + let state_update = config.starknet_client().get_state_update(BlockId::Number(block_no)).await?; let state_update = match state_update { diff --git a/crates/orchestrator/src/tests/jobs/da_job/mod.rs b/crates/orchestrator/src/tests/jobs/da_job/mod.rs index 477570b5..5a19b921 100644 --- a/crates/orchestrator/src/tests/jobs/da_job/mod.rs +++ b/crates/orchestrator/src/tests/jobs/da_job/mod.rs @@ -26,6 +26,7 @@ use majin_blob_types::state_diffs::UnorderedEq; // use majin_blob_types::serde; use crate::data_storage::MockDataStorage; use rstest::rstest; +use serial_test::serial; use crate::tests::common::init_config; @@ -50,7 +51,7 @@ use crate::tests::common::init_config; 110 )] #[tokio::test] - +#[serial] async fn test_da_job_process_job_failure_on_impossible_blob_length( #[case] state_update_file: String, #[case] noances_file: String,