From e6d99096886c6acb12ad17e92ca86e6406ac3e7f Mon Sep 17 00:00:00 2001 From: Denis Varlakov Date: Wed, 2 Oct 2024 12:57:55 +0200 Subject: [PATCH] Fix rustc warnings Signed-off-by: Denis Varlakov --- givre/src/lib.rs | 3 +++ givre/src/signing/aggregate.rs | 1 + givre/src/signing/round2.rs | 2 ++ 3 files changed, 6 insertions(+) diff --git a/givre/src/lib.rs b/givre/src/lib.rs index 09d2fc7..88d81b7 100644 --- a/givre/src/lib.rs +++ b/givre/src/lib.rs @@ -204,6 +204,9 @@ pub mod key_share { } mod error { + // It's currently only needed in full signing, but better keep it always in the code + #![cfg_attr(not(feature = "full-signing"), allow(dead_code, unused_imports))] + #[cfg(feature = "std")] pub use std::error::Error as StdError; diff --git a/givre/src/signing/aggregate.rs b/givre/src/signing/aggregate.rs index 04b5eee..53145c5 100644 --- a/givre/src/signing/aggregate.rs +++ b/givre/src/signing/aggregate.rs @@ -183,6 +183,7 @@ impl<'a, C: Ciphersuite> AggregateOptions<'a, C> { /// /// CAUTION: additive shift MUST BE derived from the extended public key obtained from /// the key share which is used for signing by calling [`utils::derive_additive_shift`]. + #[cfg(feature = "hd-wallet")] pub(crate) fn dangerous_set_hd_additive_shift( mut self, hd_additive_shift: Scalar, diff --git a/givre/src/signing/round2.rs b/givre/src/signing/round2.rs index 12e08c3..621b57c 100644 --- a/givre/src/signing/round2.rs +++ b/givre/src/signing/round2.rs @@ -135,6 +135,7 @@ impl<'a, C: Ciphersuite> SigningOptions<'a, C> { /// /// CAUTION: additive shift MUST BE derived from the extended public key obtained from /// the key share which is used for signing by calling [`utils::derive_additive_shift`]. + #[cfg(feature = "hd-wallet")] pub(crate) fn dangerous_set_hd_additive_shift( mut self, hd_additive_shift: Scalar, @@ -450,6 +451,7 @@ fn normalize_key_share( pub struct SigningError(Reason); #[derive(Debug)] +#[cfg_attr(not(feature = "std"), allow(dead_code))] enum Reason { #[cfg(feature = "taproot")] MissingTaprootMerkleRoot,