Skip to content

Commit dacb985

Browse files
committed
updates
1 parent 127a695 commit dacb985

File tree

1 file changed

+27
-26
lines changed

1 file changed

+27
-26
lines changed

integration_test/src/main.rs

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -124,18 +124,13 @@ fn get_auth() -> bitcoincore_rpc::Auth {
124124
fn main() {
125125
log::set_logger(&LOGGER).map(|()| log::set_max_level(log::LevelFilter::max())).unwrap();
126126

127-
let mut rpc_url = format!("{}/wallet/testdescriptorwallet", get_rpc_url());
128-
let auth = get_auth();
129-
let mut cl = Client::new(&rpc_url, auth).unwrap();
127+
let rpc_url = format!("{}/wallet/testwallet", get_rpc_url());
128+
let cl = Client::new(&rpc_url, get_auth()).unwrap();
130129

131130
test_get_network_info(&cl);
132131
unsafe { VERSION = cl.version().unwrap() };
133132
println!("Version: {}", version());
134133

135-
test_import_descriptors(&cl);
136-
137-
rpc_url = format!("{}/wallet/testwallet", get_rpc_url());
138-
cl = Client::new(&rpc_url, get_auth()).unwrap();
139134
cl.create_wallet("testwallet", None, None, None, None, None).unwrap();
140135

141136
test_get_mining_info(&cl);
@@ -207,6 +202,12 @@ fn main() {
207202
//TODO unload_wallet(&self, wallet: Option<&str>) -> Result<()> {
208203
//TODO backup_wallet(&self, destination: Option<&str>) -> Result<()> {
209204
test_stop(cl);
205+
206+
let rpc_url = format!("{}/wallet/testdescriptorwallet", get_rpc_url());
207+
let desc_cl = Client::new(&rpc_url, get_auth()).unwrap();
208+
209+
test_descriptor_wallet(&desc_cl);
210+
test_stop(desc_cl);
210211
}
211212

212213
fn test_get_network_info(cl: &Client) {
@@ -1008,25 +1009,6 @@ fn test_create_wallet(cl: &Client) {
10081009
assert!(wallet_list.iter().zip(wallet_names).all(|(a, b)| a == b));
10091010
}
10101011

1011-
fn test_import_descriptors(cl: &Client) {
1012-
cl.create_wallet(
1013-
"testdescriptorwallet",
1014-
Some(false),
1015-
Some(true),
1016-
Some(""),
1017-
Some(false),
1018-
Some(true),
1019-
)
1020-
.unwrap();
1021-
1022-
cl.import_descriptors(
1023-
"tr(tprv8ZgxMBicQKsPeRBCAfUGsZhyHy9dwWyPqhSJmaMnMJQWWtt8L2SkTeHaiF82CUCGtiTiHAs3cMkjdKckGKiCWeYtvMPF1jDTWYTryRMicpx/86h/1h/0h/0/*)#0t9kzwrk",
1024-
"tr(tprv8ZgxMBicQKsPeRBCAfUGsZhyHy9dwWyPqhSJmaMnMJQWWtt8L2SkTeHaiF82CUCGtiTiHAs3cMkjdKckGKiCWeYtvMPF1jDTWYTryRMicpx/86h/1h/0h/1/*)#7lqhlmnw",
1025-
).unwrap();
1026-
cl.get_new_address(None, Some(json::AddressType::Bech32m)).unwrap();
1027-
cl.unload_wallet(Some("testdescriptorwallet")).unwrap();
1028-
}
1029-
10301012
fn test_get_tx_out_set_info(cl: &Client) {
10311013
cl.get_tx_out_set_info().unwrap();
10321014
}
@@ -1079,3 +1061,22 @@ fn test_getblocktemplate(cl: &Client) {
10791061
fn test_stop(cl: Client) {
10801062
println!("Stopping: '{}'", cl.stop().unwrap());
10811063
}
1064+
1065+
fn test_descriptor_wallet(cl: &Client) {
1066+
cl.create_wallet(
1067+
"testdescriptorwallet",
1068+
Some(false),
1069+
Some(true),
1070+
Some(""),
1071+
Some(false),
1072+
Some(true),
1073+
)
1074+
.unwrap();
1075+
1076+
cl.import_descriptors(
1077+
"tr(tprv8ZgxMBicQKsPeRBCAfUGsZhyHy9dwWyPqhSJmaMnMJQWWtt8L2SkTeHaiF82CUCGtiTiHAs3cMkjdKckGKiCWeYtvMPF1jDTWYTryRMicpx/86h/1h/0h/0/*)#0t9kzwrk",
1078+
"tr(tprv8ZgxMBicQKsPeRBCAfUGsZhyHy9dwWyPqhSJmaMnMJQWWtt8L2SkTeHaiF82CUCGtiTiHAs3cMkjdKckGKiCWeYtvMPF1jDTWYTryRMicpx/86h/1h/0h/1/*)#7lqhlmnw",
1079+
).unwrap();
1080+
cl.get_new_address(None, Some(json::AddressType::Bech32m)).unwrap();
1081+
cl.unload_wallet(Some("testdescriptorwallet")).unwrap();
1082+
}

0 commit comments

Comments
 (0)