bump bitcoind dep to 0.11.0

This commit is contained in:
Riccardo Casatta 2021-06-17 11:44:49 +02:00
parent 4498e0f7f8
commit 42adad7dbd
No known key found for this signature in database
GPG Key ID: FD986A969E450397
2 changed files with 11 additions and 7 deletions

View File

@ -71,7 +71,7 @@ lazy_static = "1.4"
env_logger = "0.7" env_logger = "0.7"
clap = "2.33" clap = "2.33"
serial_test = "0.4" serial_test = "0.4"
bitcoind = "0.10.0" bitcoind = "0.11.0"
[[example]] [[example]]
name = "address_validator" name = "address_validator"

View File

@ -464,7 +464,7 @@ mod test {
use bitcoincore_rpc::json::CreateRawTransactionInput; use bitcoincore_rpc::json::CreateRawTransactionInput;
use bitcoincore_rpc::RawTx; use bitcoincore_rpc::RawTx;
use bitcoincore_rpc::{Auth, RpcApi}; use bitcoincore_rpc::{Auth, RpcApi};
use bitcoind::BitcoinD; use bitcoind::{BitcoinD, Conf};
use std::collections::HashMap; use std::collections::HashMap;
fn create_rpc( fn create_rpc(
@ -477,16 +477,20 @@ mod test {
let config = RpcConfig { let config = RpcConfig {
url: bitcoind.rpc_url(), url: bitcoind.rpc_url(),
auth: Auth::CookieFile(bitcoind.config.cookie_file.clone()), auth: Auth::CookieFile(bitcoind.params.cookie_file.clone()),
network, network,
wallet_name, wallet_name,
skip_blocks: None, skip_blocks: None,
}; };
RpcBlockchain::from_config(&config) RpcBlockchain::from_config(&config)
} }
fn create_bitcoind(args: Vec<String>) -> BitcoinD { fn create_bitcoind(args: Vec<&str>) -> BitcoinD {
let exe = std::env::var("BITCOIND_EXE").unwrap(); let exe = std::env::var("BITCOIND_EXE").unwrap();
bitcoind::BitcoinD::with_args(exe, args, false, bitcoind::P2P::No).unwrap() let conf = Conf {
args,
..Default::default()
};
bitcoind::BitcoinD::with_conf(exe, &conf).unwrap()
} }
const DESCRIPTOR_PUB: &'static str = "wpkh(tpubD6NzVbkrYhZ4X2yy78HWrr1M9NT8dKeWfzNiQqDdMqqa9UmmGztGGz6TaLFGsLfdft5iu32gxq1T4eMNxExNNWzVCpf9Y6JZi5TnqoC9wJq/*)"; const DESCRIPTOR_PUB: &'static str = "wpkh(tpubD6NzVbkrYhZ4X2yy78HWrr1M9NT8dKeWfzNiQqDdMqqa9UmmGztGGz6TaLFGsLfdft5iu32gxq1T4eMNxExNNWzVCpf9Y6JZi5TnqoC9wJq/*)";
@ -529,7 +533,7 @@ mod test {
generate(&bitcoind, 5); generate(&bitcoind, 5);
let config = RpcConfig { let config = RpcConfig {
url: bitcoind.rpc_url(), url: bitcoind.rpc_url(),
auth: Auth::CookieFile(bitcoind.config.cookie_file.clone()), auth: Auth::CookieFile(bitcoind.params.cookie_file.clone()),
network: Network::Regtest, network: Network::Regtest,
wallet_name: "another-name".to_string(), wallet_name: "another-name".to_string(),
skip_blocks: Some(103), skip_blocks: Some(103),
@ -559,7 +563,7 @@ mod test {
let rpc = create_rpc(&bitcoind, DESCRIPTOR_PUB, Network::Regtest).unwrap(); let rpc = create_rpc(&bitcoind, DESCRIPTOR_PUB, Network::Regtest).unwrap();
let capabilities = rpc.get_capabilities(); let capabilities = rpc.get_capabilities();
assert!(capabilities.contains(&Capability::FullHistory) && capabilities.len() == 1); assert!(capabilities.contains(&Capability::FullHistory) && capabilities.len() == 1);
let bitcoind_indexed = create_bitcoind(vec!["-txindex".to_string()]); let bitcoind_indexed = create_bitcoind(vec!["-txindex"]);
let rpc_indexed = create_rpc(&bitcoind_indexed, DESCRIPTOR_PUB, Network::Regtest).unwrap(); let rpc_indexed = create_rpc(&bitcoind_indexed, DESCRIPTOR_PUB, Network::Regtest).unwrap();
assert_eq!(rpc_indexed.get_capabilities().len(), 3); assert_eq!(rpc_indexed.get_capabilities().len(), 3);
let address = generate(&bitcoind_indexed, 101); let address = generate(&bitcoind_indexed, 101);