Skip to content

Add verifymessage feature #343

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }

Expand All @@ -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 = []
2 changes: 2 additions & 0 deletions client/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -871,6 +872,7 @@ pub trait RpcApi: Sized {
self.call("stop", &[])
}

#[cfg(feature = "verifymessage")]
fn verify_message(
&self,
address: &Address,
Expand Down
3 changes: 3 additions & 0 deletions contrib/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion integration_test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["Steven Roose <steven@stevenroose.org>"]
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"
3 changes: 3 additions & 0 deletions json/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down