From f10919a18f2999e650b45483242ca8baefd7b8b6 Mon Sep 17 00:00:00 2001 From: thedevbirb Date: Thu, 10 Oct 2024 11:32:03 +0200 Subject: [PATCH] fix(sidecar): warnings --- bolt-sidecar/src/signer/commit_boost.rs | 2 ++ bolt-sidecar/src/signer/keystore.rs | 2 +- bolt-sidecar/src/signer/local.rs | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/bolt-sidecar/src/signer/commit_boost.rs b/bolt-sidecar/src/signer/commit_boost.rs index ab928ada..01af5357 100644 --- a/bolt-sidecar/src/signer/commit_boost.rs +++ b/bolt-sidecar/src/signer/commit_boost.rs @@ -111,10 +111,12 @@ impl CommitBoostSigner { } impl CommitBoostSigner { + /// Get the public key of the signer. pub fn pubkey(&self) -> BlsPublicKey { self.get_consensus_pubkey() } + /// Sign an object root with the Commit Boost domain. pub async fn sign_commit_boost_root(&self, data: [u8; 32]) -> eyre::Result { // convert the pubkey from ethereum_consensus to commit-boost format let pubkey = cb_common::signer::BlsPublicKey::from( diff --git a/bolt-sidecar/src/signer/keystore.rs b/bolt-sidecar/src/signer/keystore.rs index 6a17fed3..9652a603 100644 --- a/bolt-sidecar/src/signer/keystore.rs +++ b/bolt-sidecar/src/signer/keystore.rs @@ -1,8 +1,8 @@ //! An ERC-2335 keystore signer. -use std::fmt::Debug; use std::{ ffi::OsString, + fmt::Debug, fs, path::{Path, PathBuf}, }; diff --git a/bolt-sidecar/src/signer/local.rs b/bolt-sidecar/src/signer/local.rs index 26423258..f9cd38f0 100644 --- a/bolt-sidecar/src/signer/local.rs +++ b/bolt-sidecar/src/signer/local.rs @@ -2,7 +2,6 @@ use std::fmt::Debug; use blst::{min_pk::Signature, BLST_ERROR}; use ethereum_consensus::{crypto::PublicKey as BlsPublicKey, deneb::compute_signing_root}; -use rand::RngCore; use crate::{crypto::bls::BLSSig, ChainConfig}; pub use blst::min_pk::SecretKey as BlsSecretKey; @@ -99,7 +98,9 @@ impl LocalSigner { } /// Generate a random BLS secret key. +#[cfg(test)] pub fn random_bls_secret() -> BlsSecretKey { + use rand::RngCore; let mut rng = rand::thread_rng(); let mut ikm = [0u8; 32]; rng.fill_bytes(&mut ikm);