diff --git a/client/Cargo.toml b/client/Cargo.toml index cb2573d1..4f1f67ea 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -18,6 +18,9 @@ edition = "2018" name = "bitcoincore_rpc" path = "src/lib.rs" +[features] +verifymessage = ["bitcoincore-rpc-json/verifymessage"] + [dependencies] bitcoincore-rpc-json = { version = "0.18.0", path = "../json" } @@ -31,3 +34,10 @@ serde_json = "1" [dev-dependencies] tempfile = "3.3.0" +[[example]] +name = "retry_client" +required-features = ["verifymessage"] + +[[example]] +name = "test_against_node" +required-features = [] diff --git a/client/src/client.rs b/client/src/client.rs index 5a917903..a17bdf85 100644 --- a/client/src/client.rs +++ b/client/src/client.rs @@ -23,6 +23,7 @@ use serde_json; use crate::bitcoin::address::{NetworkUnchecked, NetworkChecked}; use crate::bitcoin::hashes::hex::FromHex; +#[cfg(feature = "verifymessage")] use bitcoin::sign_message::MessageSignature; use crate::bitcoin::{ Address, Amount, Block, OutPoint, PrivateKey, PublicKey, Script, Transaction, @@ -871,6 +872,7 @@ pub trait RpcApi: Sized { self.call("stop", &[]) } + #[cfg(feature = "verifymessage")] fn verify_message( &self, address: &Address, diff --git a/contrib/test.sh b/contrib/test.sh index e308ce3c..2aa5a279 100755 --- a/contrib/test.sh +++ b/contrib/test.sh @@ -16,7 +16,10 @@ fi # Test pinned versions. if cargo --version | grep ${MSRV}; then cargo update -p tempfile --precise 3.3.0 + cargo update -p cc --precise 1.0.79 cargo update -p log --precise 0.4.18 + cargo update -p serde_json --precise 1.0.96 + cargo update -p serde --precise 1.0.156 fi # Integration test. diff --git a/integration_test/Cargo.toml b/integration_test/Cargo.toml index 8ad6c1b5..9b4a8b5e 100644 --- a/integration_test/Cargo.toml +++ b/integration_test/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Steven Roose "] edition = "2018" [dependencies] -bitcoincore-rpc = { path = "../client" } +bitcoincore-rpc = { path = "../client", features = ["verifymessage"] } bitcoin = { version = "0.31.0", features = ["serde", "rand", "base64"]} lazy_static = "1.4.0" log = "0.4" diff --git a/json/Cargo.toml b/json/Cargo.toml index 8f3d67cc..ebf2f1d0 100644 --- a/json/Cargo.toml +++ b/json/Cargo.toml @@ -19,6 +19,9 @@ rust-version = "1.56.1" name = "bitcoincore_rpc_json" path = "src/lib.rs" +[features] +verifymessage = ["bitcoin/base64"] + [dependencies] serde = { version = "1", features = [ "derive" ] } serde_json = "1"