mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-09 19:51:47 +00:00
Replace lazy_static! with LazyLock (#6189)
* Replace `lazy_static` with `LazyLock`. * Merge branch 'unstable' into remove-lazy-static # Conflicts: # beacon_node/lighthouse_network/src/peer_manager/mod.rs * Lint fixes. * Merge branch 'unstable' into remove-lazy-static # Conflicts: # beacon_node/beacon_chain/src/metrics.rs * Moar lint fixes. * Update rust version to 1.80.0. * Merge branch 'unstable' into remove-lazy-static
This commit is contained in:
@@ -10,7 +10,6 @@ use environment::null_logger;
|
||||
use execution_block_generator::PoWBlock;
|
||||
use handle_rpc::handle_rpc;
|
||||
use kzg::Kzg;
|
||||
use lazy_static::lazy_static;
|
||||
use parking_lot::{Mutex, RwLock, RwLockWriteGuard};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_json::json;
|
||||
@@ -20,7 +19,7 @@ use std::convert::Infallible;
|
||||
use std::future::Future;
|
||||
use std::marker::PhantomData;
|
||||
use std::net::{Ipv4Addr, SocketAddr, SocketAddrV4};
|
||||
use std::sync::Arc;
|
||||
use std::sync::{Arc, LazyLock};
|
||||
use tokio::{runtime, sync::oneshot};
|
||||
use types::{EthSpec, ExecutionBlockHash, Uint256};
|
||||
use warp::{http::StatusCode, Filter, Rejection};
|
||||
@@ -56,14 +55,13 @@ pub const DEFAULT_ENGINE_CAPABILITIES: EngineCapabilities = EngineCapabilities {
|
||||
get_client_version_v1: true,
|
||||
};
|
||||
|
||||
lazy_static! {
|
||||
pub static ref DEFAULT_CLIENT_VERSION: JsonClientVersionV1 = JsonClientVersionV1 {
|
||||
pub static DEFAULT_CLIENT_VERSION: LazyLock<JsonClientVersionV1> =
|
||||
LazyLock::new(|| JsonClientVersionV1 {
|
||||
code: "MC".to_string(), // "mock client"
|
||||
name: "Mock Execution Client".to_string(),
|
||||
version: "0.1.0".to_string(),
|
||||
commit: "0xabcdef01".to_string(),
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
mod execution_block_generator;
|
||||
mod handle_rpc;
|
||||
|
||||
Reference in New Issue
Block a user