diff --git a/.circleci/config.yml b/.circleci/config.yml index 12c62e2..a071148 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -26,6 +26,7 @@ jobs: cargo build --features=yubihsm cargo build --features=ledgertm cargo build --features=yubihsm,ledgertm,softsign + cd tendermint-rs && cargo build --no-default-features - run: name: build --release command: | diff --git a/Cargo.lock b/Cargo.lock index b9ccc9a..972f5f5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -916,6 +916,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "serde" version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "serde_derive" @@ -1112,22 +1115,20 @@ dependencies = [ "chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "digest 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "hkdf 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "prost-amino 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "prost-amino-derive 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "ring 0.14.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", "sha2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "signatory 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", "signatory-dalek 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "subtle 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "subtle-encoding 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "tai64 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "x25519-dalek 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "zeroize 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "x25519-dalek 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "zeroize 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1271,7 +1272,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "x25519-dalek" -version = "0.4.5" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "clear_on_drop 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1325,6 +1326,24 @@ name = "zeroize" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "zeroize" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "zeroize_derive 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "zeroize_derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.29 (registry+https://github.com/rust-lang/crates.io-index)", +] + [metadata] "checksum abscissa 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "159a56ddefc6675d47b8063aada781ca621be8c7ac3adfc6520647024fd3461b" "checksum abscissa_derive 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ef4cd3ff1140f337a6d49256197c1455e2fb97ed76b2f220606809974f128814" @@ -1469,7 +1488,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "92c1eb33641e276cfa214a0522acad57be5c56b10cb348b3c5117db75f3ac4b0" "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -"checksum x25519-dalek 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "58e75de7a035f694df91838afa87faa8278bc484fa8d7dc34b5a24535cc2bb41" +"checksum x25519-dalek 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7ee1585dc1484373cbc1cee7aafda26634665cf449436fd6e24bfd1fad230538" "checksum yubihsm 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b61bfeae6f2ff19327d5ce0c9263afd7f80bda2c3fc5ffd9afd98146d0e72457" "checksum zeroize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d7ddffec9ddef28ba2d6359bcbf0dc6772e62b112bc103dfb1e6fab46cd47c39" "checksum zeroize 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8ddfeb6eee2fb3b262ef6e0898a52b7563bb8e0d5955a313b3cf2f808246ea14" +"checksum zeroize 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e68403b858b6af538b11614e62dfe9ab2facba9f13a0cafb974855cfb495ec95" +"checksum zeroize_derive 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b3f07490820219949839d0027b965ffdd659d75be9220c00798762e36c6cd281" diff --git a/Cargo.toml b/Cargo.toml index a0f31c4..97df756 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,7 +42,7 @@ signatory-dalek = "0.11" signatory-secp256k1 = "0.11" subtle = "2" subtle-encoding = { version = "0.3", features = ["bech32-preview"] } -tendermint = { version = "0.5.0-alpha1", path = "tendermint-rs" } +tendermint = { version = "0.5", path = "tendermint-rs" } tiny-bip39 = "0.6" wait-timeout = "0.2" yubihsm = { version = "0.22", features = ["setup", "usb"], optional = true } diff --git a/src/error.rs b/src/error.rs index b77d120..0bc1f71 100644 --- a/src/error.rs +++ b/src/error.rs @@ -9,8 +9,7 @@ use std::{ fmt::{self, Display}, io, }; -use tendermint; -use tendermint::amino_types::validate::ValidationError as TmValidationError; +use tendermint::amino_types::validate::ValidationError; /// Error type #[derive(Debug)] @@ -142,7 +141,7 @@ impl From for KmsError { } impl From for KmsError { - fn from(other: tendermint::Error) -> Self { + fn from(other: tendermint::error::Error) -> Self { let kind = match other { tendermint::Error::Crypto => KmsErrorKind::CryptoError, tendermint::Error::InvalidKey => KmsErrorKind::InvalidKey, @@ -158,8 +157,8 @@ impl From for KmsError { } } -impl From for KmsError { - fn from(other: TmValidationError) -> Self { +impl From for KmsError { + fn from(other: ValidationError) -> Self { err!(KmsErrorKind::InvalidMessageError, other).into() } } diff --git a/src/session.rs b/src/session.rs index 31ea6ab..ae07cb6 100644 --- a/src/session.rs +++ b/src/session.rs @@ -24,7 +24,7 @@ use std::{ }; use subtle::ConstantTimeEq; use tendermint::{ - amino_types::{PingRequest, PingResponse, PubKeyRequest}, + amino_types::{PingRequest, PingResponse, PubKeyRequest, PubKeyResponse}, secret_connection::{self, SecretConnection}, }; @@ -170,8 +170,8 @@ where /// Get the public key for (the only) public key in the keyring fn get_public_key(&mut self, _request: &PubKeyRequest) -> Result { - Ok(Response::PublicKey( - KeyRing::default_pubkey()?.to_response(), - )) + Ok(Response::PublicKey(PubKeyResponse::from( + *KeyRing::default_pubkey()?, + ))) } } diff --git a/tendermint-rs/Cargo.toml b/tendermint-rs/Cargo.toml index 078e377..2a2069c 100644 --- a/tendermint-rs/Cargo.toml +++ b/tendermint-rs/Cargo.toml @@ -32,37 +32,33 @@ bytes = "0.4" chrono = { version = "0.4", features = ["serde"] } digest = "0.8" failure = "0.1" -failure_derive = "0.1" hkdf = { version = "0.7", optional = true } prost-amino = { version = "0.4.0", optional = true } prost-amino-derive = { version = "0.4.0", optional = true } rand_os = { version = "0.1", optional = true } ring = { version = "0.14", optional = true } -serde = { version = "1", optional = true } -serde_derive = { version = "1", optional = true } -signatory = { version = "0.11.2", optional = true, features = ["ed25519", "ecdsa"] } +serde = { version = "1", optional = true, features = ["derive"] } +signatory = { version = "0.11.2", features = ["ed25519", "ecdsa"] } signatory-dalek = { version = "0.11", optional = true } sha2 = { version = "0.8", optional = true, default-features = false } subtle = { version = "2", optional = true } subtle-encoding = { version = "0.3", features = ["bech32-preview"] } tai64 = { version = "1", optional = true, features = ["chrono"] } -x25519-dalek = { version = "0.4.4", optional = true, default-features = false, features = ["u64_backend"] } -zeroize = { version = "0.5.2", optional = true } +x25519-dalek = { version = "0.5", optional = true, default-features = false, features = ["u64_backend"] } +zeroize = { version = "0.6", optional = true } [features] -default = ["secret-connection", "serializers", "tai64"] +default = ["secret-connection", "serde", "tai64"] +amino-types = ["prost-amino", "prost-amino-derive"] secret-connection = [ + "amino-types", "byteorder", "hkdf", - "prost-amino", - "prost-amino-derive", "rand_os", "ring", - "signatory", "signatory-dalek", "sha2", "subtle", "x25519-dalek", "zeroize" ] -serializers = ["serde", "serde_derive"] diff --git a/tendermint-rs/src/amino_types/mod.rs b/tendermint-rs/src/amino_types.rs similarity index 100% rename from tendermint-rs/src/amino_types/mod.rs rename to tendermint-rs/src/amino_types.rs diff --git a/tendermint-rs/src/amino_types/block_id.rs b/tendermint-rs/src/amino_types/block_id.rs index fb3ade2..30a5cb3 100644 --- a/tendermint-rs/src/amino_types/block_id.rs +++ b/tendermint-rs/src/amino_types/block_id.rs @@ -29,7 +29,7 @@ impl ConsensusMessage for BlockId { } self.parts_header .as_ref() - .map_or(Ok(()), |psh| psh.validate_basic()) + .map_or(Ok(()), ConsensusMessage::validate_basic) } } diff --git a/tendermint-rs/src/amino_types/ed25519.rs b/tendermint-rs/src/amino_types/ed25519.rs index da567fb..c170217 100644 --- a/tendermint-rs/src/amino_types/ed25519.rs +++ b/tendermint-rs/src/amino_types/ed25519.rs @@ -1,4 +1,5 @@ -use signatory::ed25519::{PublicKey, PUBLIC_KEY_SIZE}; +use crate::public_keys::PublicKey; +use signatory::ed25519::PUBLIC_KEY_SIZE; // Note:On the golang side this is generic in the sense that it could everything that implements // github.com/tendermint/tendermint/crypto.PubKey @@ -19,21 +20,23 @@ pub struct PubKeyResponse { #[amino_name = "tendermint/remotesigner/PubKeyRequest"] pub struct PubKeyRequest {} -impl Into for PubKeyResponse { +impl From for PublicKey { // This does not check if the underlying pub_key_ed25519 has the right size. // The caller needs to make sure that this is actually the case. - fn into(self) -> PublicKey { + fn from(response: PubKeyResponse) -> PublicKey { let mut public_key = [0u8; PUBLIC_KEY_SIZE]; - public_key.copy_from_slice(self.pub_key_ed25519.as_ref()); - PublicKey(public_key) + public_key.copy_from_slice(response.pub_key_ed25519.as_ref()); + PublicKey::Ed25519(signatory::ed25519::PublicKey::new(public_key)) } } -impl Into for PublicKey { - fn into(self) -> PubKeyResponse { - let pk = self.0.to_vec(); - PubKeyResponse { - pub_key_ed25519: pk, +impl From for PubKeyResponse { + fn from(public_key: PublicKey) -> PubKeyResponse { + match public_key { + PublicKey::Ed25519(ref pk) => PubKeyResponse { + pub_key_ed25519: pk.as_bytes().to_vec(), + }, + PublicKey::Secp256k1(_) => panic!("secp256k1 PubKeyResponse unimplemented"), } } } @@ -137,7 +140,7 @@ mod tests { 0xe7, 0xc1, 0xd4, 0x69, 0xc3, 0x44, 0x26, 0xec, 0xef, 0xc0, 0x72, 0xa, 0x52, 0x4d, 0x37, 0x32, 0xef, 0xed, ]; - let want = PublicKey(raw_pk); + let want = PublicKey::Ed25519(signatory::ed25519::PublicKey::new(raw_pk)); let pk = PubKeyResponse { pub_key_ed25519: vec![ 0x79, 0xce, 0xd, 0xe0, 0x43, 0x33, 0x4a, 0xec, 0xe0, 0x8b, 0x7b, 0xb5, 0x61, 0xbc, diff --git a/tendermint-rs/src/amino_types/validate.rs b/tendermint-rs/src/amino_types/validate.rs index 760231b..26984b1 100644 --- a/tendermint-rs/src/amino_types/validate.rs +++ b/tendermint-rs/src/amino_types/validate.rs @@ -1,3 +1,5 @@ +use failure::*; + pub trait ConsensusMessage { fn validate_basic(&self) -> Result<(), ValidationError>; } diff --git a/tendermint-rs/src/amino_types/vote.rs b/tendermint-rs/src/amino_types/vote.rs index 263ab09..9df60f7 100644 --- a/tendermint-rs/src/amino_types/vote.rs +++ b/tendermint-rs/src/amino_types/vote.rs @@ -198,7 +198,7 @@ impl ConsensusMessage for Vote { self.block_id .as_ref() - .map_or(Ok(()), |bid| bid.validate_basic()) + .map_or(Ok(()), ConsensusMessage::validate_basic) // signature will be missing as the KMS provides it } diff --git a/tendermint-rs/src/block/mod.rs b/tendermint-rs/src/block.rs similarity index 100% rename from tendermint-rs/src/block/mod.rs rename to tendermint-rs/src/block.rs diff --git a/tendermint-rs/src/block/height.rs b/tendermint-rs/src/block/height.rs index 5f308e8..a3e43c2 100644 --- a/tendermint-rs/src/block/height.rs +++ b/tendermint-rs/src/block/height.rs @@ -1,9 +1,11 @@ use crate::error::Error; +#[cfg(feature = "serde")] +use serde::{Deserialize, Serialize}; use std::fmt::{self, Debug, Display}; /// Block height for a particular chain (i.e. number of blocks created since /// the chain began) -#[cfg_attr(feature = "serializers", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[derive(Copy, Clone, Default, Eq, Hash, PartialEq, PartialOrd, Ord)] pub struct Height(pub u64); diff --git a/tendermint-rs/src/block/id.rs b/tendermint-rs/src/block/id.rs index 6e4331a..1c8b501 100644 --- a/tendermint-rs/src/block/id.rs +++ b/tendermint-rs/src/block/id.rs @@ -1,4 +1,4 @@ -#[cfg(feature = "serializers")] +#[cfg(feature = "serde")] use serde::{de::Error as DeError, Deserialize, Deserializer, Serialize, Serializer}; use std::{ fmt::{self, Display}, @@ -37,14 +37,14 @@ impl FromStr for Id { } } -#[cfg(feature = "serializers")] +#[cfg(feature = "serde")] impl Serialize for Id { fn serialize(&self, serializer: S) -> Result { self.to_string().serialize(serializer) } } -#[cfg(feature = "serializers")] +#[cfg(feature = "serde")] impl<'de> Deserialize<'de> for Id { fn deserialize>(deserializer: De) -> Result { Self::from_str(&String::deserialize(deserializer)?) diff --git a/tendermint-rs/src/chain/mod.rs b/tendermint-rs/src/chain.rs similarity index 100% rename from tendermint-rs/src/chain/mod.rs rename to tendermint-rs/src/chain.rs diff --git a/tendermint-rs/src/chain/id.rs b/tendermint-rs/src/chain/id.rs index 54431d5..30684e0 100644 --- a/tendermint-rs/src/chain/id.rs +++ b/tendermint-rs/src/chain/id.rs @@ -1,7 +1,7 @@ //! Tendermint blockchain identifiers use crate::error::Error; -#[cfg(feature = "serializers")] +#[cfg(feature = "serde")] use serde::{de::Error as DeError, Deserialize, Deserializer, Serialize, Serializer}; use std::{ cmp::Ordering, @@ -104,14 +104,14 @@ impl PartialEq for Id { impl Eq for Id {} -#[cfg(feature = "serializers")] +#[cfg(feature = "serde")] impl Serialize for Id { fn serialize(&self, serializer: S) -> Result { self.as_str().serialize(serializer) } } -#[cfg(feature = "serializers")] +#[cfg(feature = "serde")] impl<'de> Deserialize<'de> for Id { fn deserialize>(deserializer: D) -> Result { Self::from_str(&String::deserialize(deserializer)?) diff --git a/tendermint-rs/src/chain/state.rs b/tendermint-rs/src/chain/state.rs index 814c885..9cd1e04 100644 --- a/tendermint-rs/src/chain/state.rs +++ b/tendermint-rs/src/chain/state.rs @@ -1,9 +1,12 @@ //! State of a particular Tendermint network (a.k.a. chain) use crate::block; +#[cfg(feature = "serde")] +use serde::{Deserialize, Serialize}; /// Tendermint consensus state -#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[derive(Clone, Debug, Default, Eq, PartialEq)] pub struct ConsensusState { /// Current block height pub height: block::Height, diff --git a/tendermint-rs/src/error.rs b/tendermint-rs/src/error.rs index 164320e..2e11db2 100644 --- a/tendermint-rs/src/error.rs +++ b/tendermint-rs/src/error.rs @@ -1,11 +1,9 @@ //! Error types +use failure::*; +use std::io; #[cfg(feature = "secret-connection")] -use { - chrono, prost, signatory, - std::{self, io}, - subtle_encoding, -}; +use {chrono, prost, subtle_encoding}; /// Kinds of errors #[derive(Copy, Clone, Eq, PartialEq, Debug, Fail)] @@ -72,14 +70,12 @@ impl From for Error { } } -#[cfg(feature = "secret-connection")] impl From for Error { fn from(_: subtle_encoding::Error) -> Error { Error::Parse } } -#[cfg(feature = "secret-connection")] impl From for Error { fn from(other: signatory::Error) -> Self { match other.kind() { diff --git a/tendermint-rs/src/lib.rs b/tendermint-rs/src/lib.rs index cb587cf..dc74063 100644 --- a/tendermint-rs/src/lib.rs +++ b/tendermint-rs/src/lib.rs @@ -19,18 +19,14 @@ html_root_url = "https://docs.rs/tendermint/0.5.0" )] -#[macro_use] -extern crate failure_derive; -#[cfg(feature = "secret-connection")] +#[cfg(feature = "amino-types")] extern crate prost_amino as prost; -#[cfg(feature = "secret-connection")] +#[cfg(feature = "amino-types")] #[macro_use] extern crate prost_amino_derive as prost_derive; -#[cfg(feature = "serializers")] -#[macro_use] -extern crate serde_derive; pub mod algorithm; +#[cfg(feature = "amino-types")] pub mod amino_types; pub mod block; pub mod chain; @@ -47,7 +43,7 @@ pub use crate::{ algorithm::*, block::{ParseHeight as ParseBlockHeight, ParseId as ParseBlockId}, chain::ParseId as ParseChainId, - error::*, + error::Error, hash::*, public_keys::*, timestamp::*, diff --git a/tendermint-rs/src/public_keys.rs b/tendermint-rs/src/public_keys.rs index 7d331a6..e0a9517 100644 --- a/tendermint-rs/src/public_keys.rs +++ b/tendermint-rs/src/public_keys.rs @@ -1,6 +1,6 @@ //! Public keys used in Tendermint networks -use crate::{amino_types::PubKeyResponse, error::Error}; +use crate::error::Error; use signatory::{ecdsa::curve::secp256k1, ed25519}; use std::ops::Deref; use subtle_encoding::{bech32, hex}; @@ -62,16 +62,6 @@ impl PublicKey { pub fn to_hex(self) -> String { String::from_utf8(hex::encode_upper(self.to_amino_bytes())).unwrap() } - - /// Create a response which represents this public key - pub fn to_response(self) -> PubKeyResponse { - match self { - PublicKey::Ed25519(ref pk) => PubKeyResponse { - pub_key_ed25519: pk.as_bytes().to_vec(), - }, - PublicKey::Secp256k1(_) => panic!("secp256k1 PubKeyResponse unimplemented"), - } - } } impl From for PublicKey { diff --git a/tendermint-rs/src/secret_connection/mod.rs b/tendermint-rs/src/secret_connection.rs similarity index 99% rename from tendermint-rs/src/secret_connection/mod.rs rename to tendermint-rs/src/secret_connection.rs index 8180aff..ce7135b 100644 --- a/tendermint-rs/src/secret_connection/mod.rs +++ b/tendermint-rs/src/secret_connection.rs @@ -19,7 +19,7 @@ use std::{ io::{self, Read, Write}, marker::{Send, Sync}, }; -use x25519_dalek::{EphemeralPublic, EphemeralSecret}; +use x25519_dalek::{EphemeralSecret, PublicKey as EphemeralPublic}; /// Size of the MAC tag pub const TAG_SIZE: usize = 16; diff --git a/tendermint-rs/src/timestamp.rs b/tendermint-rs/src/timestamp.rs index 68f470c..9846a6f 100644 --- a/tendermint-rs/src/timestamp.rs +++ b/tendermint-rs/src/timestamp.rs @@ -2,12 +2,14 @@ use crate::error::Error; use chrono::{DateTime, Utc}; +#[cfg(feature = "serde")] +use serde::{Deserialize, Serialize}; use std::time::{Duration, SystemTime, UNIX_EPOCH}; #[cfg(feature = "tai64")] use tai64::TAI64N; /// Chain timestamps (e.g. consensus time) -#[cfg_attr(feature = "serializers", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[derive(Copy, Clone, Debug, Eq, PartialEq, PartialOrd, Ord)] pub struct Timestamp(DateTime); diff --git a/tendermint-rs/tests/integration.rs b/tendermint-rs/tests/integration.rs index 4f71b4f..8dfbaa3 100644 --- a/tendermint-rs/tests/integration.rs +++ b/tendermint-rs/tests/integration.rs @@ -1,15 +1,17 @@ //! `SecretConnection` integration tests -extern crate subtle_encoding; -extern crate tendermint; - +#[cfg(features = "secret-connection")] use self::subtle_encoding::hex; -use std::fs::File; -use std::io::BufRead; -use std::io::BufReader; -use std::str::FromStr; +#[cfg(features = "secret-connection")] +use std::{ + fs::File, + io::{BufRead, BufReader}, + str::FromStr, +}; +#[cfg(features = "secret-connection")] use tendermint::secret_connection::Kdf; +#[cfg(features = "secret-connection")] #[test] fn test_derive_secrets_and_challenge_golden_test_vectors() { let f = File::open("tests/support/TestDeriveSecretsAndChallenge.golden").unwrap();