Skip to content

Commit dcaa5ca

Browse files
committed
Add verifymessage feature
In rust-bitcoin#326 we changed a function to use `bitcoin::sign_message::MessageSignature` but doing so requires the "base64" feature to be on for `bitcoin`. This did not get caught by CI but improvements to CI in rust-bitcoin#338 will now catch this. Add a feature to `json` and `client` that allows enabling "base64" if the `verifymessage` RPC call is required.
1 parent 2d06bca commit dcaa5ca

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

client/Cargo.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ edition = "2018"
1919
name = "bitcoincore_rpc"
2020
path = "src/lib.rs"
2121

22+
[features]
23+
verifymessage = ["bitcoincore-rpc-json/verifymessage"]
24+
2225
[dependencies]
2326
bitcoincore-rpc-json = { version = "0.18.0", path = "../json" }
2427

@@ -32,3 +35,10 @@ serde_json = "1"
3235
[dev-dependencies]
3336
tempfile = "3.3.0"
3437

38+
[[example]]
39+
name = "retry_client"
40+
required-features = ["verifymessage"]
41+
42+
[[example]]
43+
name = "test_against_node"
44+
required-features = []

client/src/client.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,7 @@ pub trait RpcApi: Sized {
871871
self.call("stop", &[])
872872
}
873873

874+
#[cfg(feature = "verifymessage")]
874875
fn verify_message(
875876
&self,
876877
address: &Address,

integration_test/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ authors = ["Steven Roose <steven@stevenroose.org>", "Tobin C. Harding <me@tobin.
55
edition = "2018"
66

77
[dependencies]
8-
bitcoincore-rpc = { path = "../client" }
8+
bitcoincore-rpc = { path = "../client", features = ["verifymessage"] }
99
bitcoin = { version = "0.31.0", features = ["serde", "rand", "base64"]}
1010
lazy_static = "1.4.0"
1111
log = "0.4"

json/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ rust-version = "1.56.1"
2020
name = "bitcoincore_rpc_json"
2121
path = "src/lib.rs"
2222

23+
[features]
24+
verifymessage = ["bitcoin/base64"]
25+
2326
[dependencies]
2427
serde = { version = "1", features = [ "derive" ] }
2528
serde_json = "1"

0 commit comments

Comments
 (0)