From c7eecd159eb2d5ffc7bc6e4c5cf37d15369223c8 Mon Sep 17 00:00:00 2001 From: Jonas Nick Date: Mon, 20 May 2019 19:41:10 +0000 Subject: [PATCH] Feature gate recovery module --- .travis.yml | 3 ++- Cargo.toml | 3 ++- src/lib.rs | 1 + src/recovery.rs | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3cc8800..a457eb5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,10 +24,11 @@ script: - cargo build --verbose --features=rand - cargo test --verbose --features=rand - cargo test --verbose --features="rand serde" + - cargo test --verbose --features="rand serde recovery" - cargo build --verbose --no-default-features - cargo build --verbose --no-default-features --features="serde" - cargo build --verbose --no-default-features --features="rand" - - cargo build --verbose --no-default-features --features="rand serde" + - cargo build --verbose --no-default-features --features="rand serde recovery" - cargo build --verbose - cargo test --verbose - cargo build --release diff --git a/Cargo.toml b/Cargo.toml index 31a8c6e..c7c876e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ build = "build.rs" # Should make docs.rs show all functions, even those behind non-default features [package.metadata.docs.rs] -features = [ "rand", "serde" ] +features = [ "rand", "serde", "recovery" ] all-features = true [build-dependencies] @@ -30,6 +30,7 @@ unstable = [] default = ["std"] fuzztarget = [] std = [] +recovery = [] [dev-dependencies] rand = "0.6" diff --git a/src/lib.rs b/src/lib.rs index 6277cb1..e1bf172 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -152,6 +152,7 @@ pub mod constants; pub mod ecdh; pub mod ffi; pub mod key; +#[cfg(feature = "recovery")] pub mod recovery; pub use key::SecretKey; diff --git a/src/recovery.rs b/src/recovery.rs index c04005d..73e5367 100644 --- a/src/recovery.rs +++ b/src/recovery.rs @@ -174,7 +174,7 @@ impl Secp256k1 { mod tests { use rand::{RngCore, thread_rng}; - use key::{SecretKey, PublicKey}; + use key::SecretKey; use super::{RecoveryId, RecoverableSignature}; use super::super::{Secp256k1, Message}; use super::super::Error::{IncorrectSignature, InvalidSignature};