Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
1) SECP256k1_BUILD is already set, so setting to Some("") avoids the
duplicate warning
2) Misc rust unused warnings in various feature flag combinations
  • Loading branch information
sanket1729 committed Mar 14, 2022
1 parent 082cb08 commit 3dda438
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion secp256k1-zkp-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fn main() {
.include("depend/secp256k1/include")
.include("depend/secp256k1/src")
.flag_if_supported("-Wno-unused-function") // some ecmult stuff is defined but not used upstream
.define("SECP256K1_BUILD", Some("1"))
.define("SECP256K1_BUILD", Some(""))
.define("ENABLE_MODULE_SURJECTIONPROOF", Some("1"))
.define("ENABLE_MODULE_GENERATOR", Some("1"))
.define("ENABLE_MODULE_RANGEPROOF", Some("1"))
Expand Down
4 changes: 3 additions & 1 deletion src/zkp/ecdsa_adaptor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,11 @@ impl EcdsaAdaptorSignature {
mod tests {
use super::Message;
use super::*;
use rand::{rngs::ThreadRng, thread_rng, RngCore};
use SECP256K1;
#[cfg(not(rust_secp_fuzz))]
use rand::{rngs::ThreadRng, thread_rng, RngCore};

#[cfg(not(rust_secp_fuzz))]
fn test_ecdsa_adaptor_signature_helper(
encrypt: fn(&Message, &SecretKey, &PublicKey, &mut ThreadRng) -> EcdsaAdaptorSignature,
) {
Expand Down
1 change: 1 addition & 0 deletions src/zkp/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ impl Generator {
///
/// This is `pub(crate)` because generators have a different serialization from regular public keys.
/// As such, certain invariants need to be upheld which is easier if we don't allow users to access the internal representation of generators.
#[cfg(feature = "std")] // for un-used warnings
pub(crate) fn as_inner(&self) -> &ffi::PublicKey {
&self.0
}
Expand Down
2 changes: 1 addition & 1 deletion src/zkp/tag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ impl Tag {
self.0
}

#[cfg(feature = "rand")]
#[cfg(all(feature = "rand", feature = "std"))]
pub(crate) fn as_inner(&self) -> &ffi::Tag {
&self.0
}
Expand Down

0 comments on commit 3dda438

Please sign in to comment.