Skip to content

Commit 262ee7d

Browse files
committed
chore: revert to LazyStatic
1 parent 49d5d65 commit 262ee7d

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

testnet/stacks-node/src/nakamoto_node/relayer.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ use std::collections::HashSet;
1818
use std::fs;
1919
use std::io::Read;
2020
use std::sync::mpsc::{Receiver, RecvTimeoutError};
21+
#[cfg(test)]
22+
use std::sync::LazyLock;
2123
use std::thread::JoinHandle;
2224
use std::time::{Duration, Instant};
2325

24-
#[cfg(test)]
25-
use lazy_static::lazy_static;
2626
use rand::{thread_rng, Rng};
2727
use stacks::burnchains::{Burnchain, Txid};
2828
use stacks::chainstate::burn::db::sortdb::SortitionDB;
@@ -72,13 +72,13 @@ use crate::run_loop::RegisteredKey;
7272
use crate::BitcoinRegtestController;
7373

7474
#[cfg(test)]
75-
lazy_static! {
76-
/// Mutex to stall the relayer thread right before it creates a miner thread.
77-
pub static ref TEST_MINER_THREAD_STALL: TestFlag<bool> = TestFlag::default();
75+
/// Mutex to stall the relayer thread right before it creates a miner thread.
76+
pub static TEST_MINER_THREAD_STALL: LazyLock<TestFlag<bool>> = LazyLock::new(TestFlag::default);
7877

79-
/// Mutex to stall the miner thread right after it starts up (does not block the relayer thread)
80-
pub static ref TEST_MINER_THREAD_START_STALL: TestFlag<bool> = TestFlag::default();
81-
}
78+
#[cfg(test)]
79+
/// Mutex to stall the miner thread right after it starts up (does not block the relayer thread)
80+
pub static TEST_MINER_THREAD_START_STALL: LazyLock<TestFlag<bool>> =
81+
LazyLock::new(TestFlag::default);
8282

8383
/// Command types for the Nakamoto relayer thread, issued to it by other threads
8484
#[allow(clippy::large_enum_variant)]

0 commit comments

Comments
 (0)