From 8208c14793b92fd11d9bcf0c175f32633a41fb20 Mon Sep 17 00:00:00 2001 From: Meshi Peled <141231558+meship-starkware@users.noreply.github.com> Date: Wed, 1 May 2024 14:19:06 +0300 Subject: [PATCH] feat(concurrency): move versioned_state_for_testing to concurrency test utils (#1835) --- crates/blockifier/src/concurrency/test_utils.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/crates/blockifier/src/concurrency/test_utils.rs b/crates/blockifier/src/concurrency/test_utils.rs index 517bae060d..b7439b878c 100644 --- a/crates/blockifier/src/concurrency/test_utils.rs +++ b/crates/blockifier/src/concurrency/test_utils.rs @@ -1,3 +1,8 @@ +use std::sync::{Arc, Mutex}; + +use crate::concurrency::versioned_state_proxy::VersionedState; +use crate::state::state_api::StateReader; + #[macro_export] macro_rules! default_scheduler { ($chunk_size:ident : $chunk:expr , $($field:ident $(: $value:expr)?),+ $(,)?) => { @@ -25,3 +30,10 @@ macro_rules! default_scheduler { } }; } + +// TODO(meshi, 01/06/2024): Consider making this a macro. +pub fn versioned_state_for_testing( + block_state: impl StateReader, +) -> Arc>> { + Arc::new(Mutex::new(VersionedState::new(block_state))) +}