mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 20:29:23 +00:00
replace lazy_static! with once_cell::sync::Lazy
This commit is contained in:
@@ -53,6 +53,8 @@ use crate::{
|
||||
Payment,
|
||||
};
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, Debug)]
|
||||
pub struct OutputId(pub [u8; 36]);
|
||||
impl Default for OutputId {
|
||||
@@ -259,10 +261,8 @@ impl BlockTrait<Bitcoin> for Block {
|
||||
}
|
||||
|
||||
const KEY_DST: &[u8] = b"Serai Bitcoin Output Offset";
|
||||
lazy_static::lazy_static! {
|
||||
static ref BRANCH_OFFSET: Scalar = Secp256k1::hash_to_F(KEY_DST, b"branch");
|
||||
static ref CHANGE_OFFSET: Scalar = Secp256k1::hash_to_F(KEY_DST, b"change");
|
||||
}
|
||||
static BRANCH_OFFSET: Lazy<Scalar> = Lazy::new(|| Secp256k1::hash_to_F(KEY_DST, b"branch"));
|
||||
static CHANGE_OFFSET: Lazy<Scalar> = Lazy::new(|| Secp256k1::hash_to_F(KEY_DST, b"change"));
|
||||
|
||||
// Always construct the full scanner in order to ensure there's no collisions
|
||||
fn scanner(
|
||||
|
||||
@@ -16,9 +16,7 @@ mod addresses;
|
||||
pub(crate) use addresses::test_addresses;
|
||||
|
||||
// Effective Once
|
||||
lazy_static::lazy_static! {
|
||||
static ref INIT_LOGGER: () = env_logger::init();
|
||||
}
|
||||
static INIT_LOGGER: once_cell::sync::Lazy<()> = once_cell::sync::Lazy::new(env_logger::init);
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! test_network {
|
||||
|
||||
Reference in New Issue
Block a user