Skip to content

Commit

Permalink
chore(bolt-sidecar): missing doc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
thedevbirb committed Nov 27, 2024
1 parent ac77925 commit a450dd8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions bolt-sidecar/src/common/score_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ impl<const GET_SCORE: isize, const INSERT_SCORE: isize, const UPDATE_SCORE: isiz
Self { map: HashMap::<K, (V, isize)>::with_capacity(capacity), max_len: usize::MAX }
}

/// Creates an empty `HashMap` with at least the specified capacity and maximum length.
#[inline]
pub fn with_capacity_and_len(capacity: usize, max_len: usize) -> Self {
Self { map: HashMap::<K, (V, isize)>::with_capacity(capacity), max_len }
Expand Down
6 changes: 5 additions & 1 deletion bolt-sidecar/src/common/secrets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ use alloy::{hex, signers::k256::ecdsa::SigningKey};
use blst::min_pk::SecretKey;
use rand::{Rng, RngCore};
use serde::{Deserialize, Deserializer};

/// A warpper for BLS secret key.
#[derive(Clone, Debug)]
pub struct BlsSecretKeyWrapper(pub SecretKey);

impl BlsSecretKeyWrapper {
/// Generate a new random BLS secret key.
pub fn random() -> Self {
let mut rng = rand::thread_rng();
let mut ikm = [0u8; 32];
Expand Down Expand Up @@ -54,12 +57,12 @@ impl fmt::Display for BlsSecretKeyWrapper {
}
}

/// A warpper for ECDSA secret key.
#[derive(Clone, Debug)]
pub struct EcdsaSecretKeyWrapper(pub SigningKey);

impl EcdsaSecretKeyWrapper {
/// Generate a new random ECDSA secret key.
#[allow(dead_code)]
pub fn random() -> Self {
Self(SigningKey::random(&mut rand::thread_rng()))
}
Expand Down Expand Up @@ -98,6 +101,7 @@ impl Deref for EcdsaSecretKeyWrapper {
}
}

/// A warpper for JWT secret key.
#[derive(Debug, Clone)]
pub struct JwtSecretConfig(pub String);

Expand Down

0 comments on commit a450dd8

Please sign in to comment.