]> Untitled Git - bdk/commitdiff
Change dependencies bitcoincore-rpc to core-rpc, update bitcoin to ^0.27 and miniscri...
authorSteve Myers <steve@notmandatory.org>
Tue, 17 Aug 2021 15:52:07 +0000 (17:52 +0200)
committerSteve Myers <steve@notmandatory.org>
Thu, 19 Aug 2021 16:16:40 +0000 (18:16 +0200)
Cargo.toml
src/blockchain/rpc.rs
src/error.rs
src/lib.rs
src/testutils/blockchain_tests.rs

index 14bc850a48aaf6e0f2381b198eb52e17996d474e..adb36231550398d9318907c2da68a9b4332db2a5 100644 (file)
@@ -14,20 +14,20 @@ license = "MIT OR Apache-2.0"
 [dependencies]
 bdk-macros = "0.5"
 log = "^0.4"
-miniscript = "5.1"
-bitcoin = { version = "~0.26.2", features = ["use-serde", "base64"] }
+miniscript = "^6.0"
+bitcoin = { version = "^0.27", features = ["use-serde", "base64"] }
 serde = { version = "^1.0", features = ["derive"] }
 serde_json = { version = "^1.0" }
 rand = "^0.7"
 
 # Optional dependencies
 sled = { version = "0.34", optional = true }
-electrum-client = { version = "0.7", optional = true }
+electrum-client = { version = "0.8", optional = true }
 reqwest = { version = "0.11", optional = true, features = ["json"] }
 ureq = { version = "2.1", default-features = false, features = ["json"], optional = true }
 futures = { version = "0.3", optional = true }
 async-trait = { version = "0.1", optional = true }
-rocksdb = { version = "0.14", optional = true }
+rocksdb = { version = "0.14", default-features = false, features = ["snappy"], optional = true }
 cc = { version = ">=1.0.64", optional = true }
 socks = { version = "0.3", optional = true }
 lazy_static = { version = "1.4", optional = true }
@@ -36,7 +36,7 @@ zeroize = { version = "<1.4.0", optional = true }
 bitcoinconsensus = { version = "0.19.0-3", optional = true }
 
 # Needed by bdk_blockchain_tests macro
-bitcoincore-rpc = { version = "0.13", optional = true }
+core-rpc = { version = "0.14", optional = true }
 
 [target.'cfg(target_arch = "wasm32")'.dependencies]
 async-trait = "0.1"
@@ -52,7 +52,7 @@ compact_filters = ["rocksdb", "socks", "lazy_static", "cc"]
 key-value-db = ["sled"]
 all-keys = ["keys-bip39"]
 keys-bip39 = ["tiny-bip39", "zeroize"]
-rpc = ["bitcoincore-rpc"]
+rpc = ["core-rpc"]
 
 # We currently provide mulitple implementations of `Blockchain`, all are
 # blocking except for the `EsploraBlockchain` which can be either async or
@@ -77,7 +77,7 @@ esplora = []
 
 
 # Debug/Test features
-test-blockchains = ["bitcoincore-rpc", "electrum-client"]
+test-blockchains = ["core-rpc", "electrum-client"]
 test-electrum = ["electrum", "electrsd/electrs_0_8_10", "test-blockchains"]
 test-rpc = ["rpc", "electrsd/electrs_0_8_10", "test-blockchains"]
 test-esplora = ["esplora", "ureq", "electrsd/legacy", "electrsd/esplora_a33e97e1", "test-blockchains"]
index fd06dcf1de8a74e5586535b8ea7c5bff48fcd178..050e5ca02d6311e11ec3972cc7c17a4f63468095 100644 (file)
@@ -38,13 +38,13 @@ use crate::database::{BatchDatabase, DatabaseUtils};
 use crate::descriptor::{get_checksum, IntoWalletDescriptor};
 use crate::wallet::utils::SecpCtx;
 use crate::{ConfirmationTime, Error, FeeRate, KeychainKind, LocalUtxo, TransactionDetails};
-use bitcoincore_rpc::json::{
+use core_rpc::json::{
     GetAddressInfoResultLabel, ImportMultiOptions, ImportMultiRequest,
     ImportMultiRequestScriptPubkey, ImportMultiRescanSince,
 };
-use bitcoincore_rpc::jsonrpc::serde_json::Value;
-use bitcoincore_rpc::Auth as RpcAuth;
-use bitcoincore_rpc::{Client, RpcApi};
+use core_rpc::jsonrpc::serde_json::Value;
+use core_rpc::Auth as RpcAuth;
+use core_rpc::{Client, RpcApi};
 use log::debug;
 use serde::{Deserialize, Serialize};
 use std::collections::{HashMap, HashSet};
@@ -82,7 +82,7 @@ pub struct RpcConfig {
     pub skip_blocks: Option<u32>,
 }
 
-/// This struct is equivalent to [bitcoincore_rpc::Auth] but it implements [serde::Serialize]
+/// This struct is equivalent to [core_rpc::Auth] but it implements [serde::Serialize]
 /// To be removed once upstream equivalent is implementing Serialize (json serialization format
 /// should be the same) https://github.com/rust-bitcoin/rust-bitcoincore-rpc/pull/181
 #[derive(Clone, Debug, Hash, Eq, PartialEq, Ord, PartialOrd, Serialize, Deserialize)]
@@ -357,7 +357,7 @@ impl ConfigurableBlockchain for RpcBlockchain {
         let wallet_url = format!("{}/wallet/{}", config.url, &wallet_name);
         debug!("connecting to {} auth:{:?}", wallet_url, config.auth);
 
-        let client = Client::new(wallet_url, config.auth.clone().into())?;
+        let client = Client::new(wallet_url.as_str(), config.auth.clone().into())?;
         let loaded_wallets = client.list_wallets()?;
         if loaded_wallets.contains(&wallet_name) {
             debug!("wallet already loaded {:?}", wallet_name);
index 73bf711953b4bd0522e81343d14538d1b21a2b69..ebbd2745b8a51caed0ded4161ef28b09a844bec2 100644 (file)
@@ -139,7 +139,7 @@ pub enum Error {
     Sled(sled::Error),
     #[cfg(feature = "rpc")]
     /// Rpc client error
-    Rpc(bitcoincore_rpc::Error),
+    Rpc(core_rpc::Error),
 }
 
 impl fmt::Display for Error {
@@ -193,7 +193,7 @@ impl_error!(electrum_client::Error, Electrum);
 #[cfg(feature = "key-value-db")]
 impl_error!(sled::Error, Sled);
 #[cfg(feature = "rpc")]
-impl_error!(bitcoincore_rpc::Error, Rpc);
+impl_error!(core_rpc::Error, Rpc);
 
 #[cfg(feature = "compact_filters")]
 impl From<crate::blockchain::compact_filters::CompactFiltersError> for Error {
index 8ece0805963b76720cd8181d66ef70b3186e0790..b340deb2853431424daae144231c3de3a8978a00 100644 (file)
@@ -236,7 +236,7 @@ extern crate bdk_macros;
 extern crate lazy_static;
 
 #[cfg(feature = "rpc")]
-pub extern crate bitcoincore_rpc;
+pub extern crate core_rpc;
 
 #[cfg(feature = "electrum")]
 pub extern crate electrum_client;
index 2df72d3234dde043841fc3a22d3a3686cb54e172..3a5e75939656ae6fc83b1e108cfba7cff9276953 100644 (file)
@@ -3,9 +3,9 @@ use bitcoin::consensus::encode::{deserialize, serialize};
 use bitcoin::hashes::hex::{FromHex, ToHex};
 use bitcoin::hashes::sha256d;
 use bitcoin::{Address, Amount, Script, Transaction, Txid};
-pub use bitcoincore_rpc::bitcoincore_rpc_json::AddressType;
-pub use bitcoincore_rpc::{Auth, Client as RpcClient, RpcApi};
 use core::str::FromStr;
+pub use core_rpc::core_rpc_json::AddressType;
+pub use core_rpc::{Auth, Client as RpcClient, RpcApi};
 use electrsd::bitcoind::BitcoinD;
 use electrsd::{bitcoind, Conf, ElectrsD};
 pub use electrum_client::{Client as ElectrumClient, ElectrumApi};