Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
feat(concurrency): move versioned_state_for_testing to concurrency te…
Browse files Browse the repository at this point in the history
…st utils (#1835)
  • Loading branch information
meship-starkware authored May 1, 2024
1 parent e66b8b2 commit 8208c14
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions crates/blockifier/src/concurrency/test_utils.rs
Original file line number Diff line number Diff line change
@@ -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)?),+ $(,)?) => {
Expand Down Expand Up @@ -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<Mutex<VersionedState<impl StateReader>>> {
Arc::new(Mutex::new(VersionedState::new(block_state)))
}

0 comments on commit 8208c14

Please sign in to comment.