mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-26 01:03:40 +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:
@@ -18,22 +18,21 @@
|
||||
//! tests](https://github.com/ethereum/eth2.0-pm/blob/6e41fcf383ebeb5125938850d8e9b4e9888389b4/interop/mocked_start/keygen_test_vector.yaml).
|
||||
use bls::{Keypair, PublicKey, SecretKey};
|
||||
use ethereum_hashing::hash;
|
||||
use lazy_static::lazy_static;
|
||||
use num_bigint::BigUint;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::fs::File;
|
||||
use std::path::PathBuf;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
pub const PRIVATE_KEY_BYTES: usize = 32;
|
||||
pub const PUBLIC_KEY_BYTES: usize = 48;
|
||||
pub const HASH_BYTES: usize = 32;
|
||||
|
||||
lazy_static! {
|
||||
static ref CURVE_ORDER: BigUint =
|
||||
"52435875175126190479447740508185965837690552500527637822603658699938581184513"
|
||||
.parse::<BigUint>()
|
||||
.expect("Curve order should be valid");
|
||||
}
|
||||
static CURVE_ORDER: LazyLock<BigUint> = LazyLock::new(|| {
|
||||
"52435875175126190479447740508185965837690552500527637822603658699938581184513"
|
||||
.parse::<BigUint>()
|
||||
.expect("Curve order should be valid")
|
||||
});
|
||||
|
||||
/// Return a G1 point for the given `validator_index`, encoded as a compressed point in
|
||||
/// big-endian byte-ordering.
|
||||
|
||||
Reference in New Issue
Block a user