@@ -19,6 +19,7 @@ extern crate log;
19
19
use bitcoincore_rpc:: core_rpc_json as bitcoincore_rpc_json;
20
20
21
21
use std:: collections:: HashMap ;
22
+ use std:: str:: FromStr ;
22
23
23
24
use bitcoincore_rpc:: json;
24
25
use bitcoincore_rpc:: jsonrpc:: error:: Error as JsonRpcError ;
@@ -201,13 +202,12 @@ fn main() {
201
202
//TODO load_wallet(&self, wallet: &str) -> Result<json::LoadWalletResult> {
202
203
//TODO unload_wallet(&self, wallet: Option<&str>) -> Result<()> {
203
204
//TODO backup_wallet(&self, destination: Option<&str>) -> Result<()> {
204
- test_stop ( cl) ;
205
205
206
206
let rpc_url = format ! ( "{}/wallet/testdescriptorwallet" , get_rpc_url( ) ) ;
207
207
let desc_cl = Client :: new ( & rpc_url, get_auth ( ) ) . unwrap ( ) ;
208
208
209
209
test_descriptor_wallet ( & desc_cl) ;
210
- test_stop ( desc_cl ) ;
210
+ test_stop ( cl ) ;
211
211
}
212
212
213
213
fn test_get_network_info ( cl : & Client ) {
@@ -1074,8 +1074,10 @@ fn test_descriptor_wallet(cl: &Client) {
1074
1074
. unwrap ( ) ;
1075
1075
1076
1076
cl. import_descriptors (
1077
- "tr (tprv8ZgxMBicQKsPeRBCAfUGsZhyHy9dwWyPqhSJmaMnMJQWWtt8L2SkTeHaiF82CUCGtiTiHAs3cMkjdKckGKiCWeYtvMPF1jDTWYTryRMicpx/86h/1h/0h/0/*)#0t9kzwrk " ,
1078
- "tr (tprv8ZgxMBicQKsPeRBCAfUGsZhyHy9dwWyPqhSJmaMnMJQWWtt8L2SkTeHaiF82CUCGtiTiHAs3cMkjdKckGKiCWeYtvMPF1jDTWYTryRMicpx/86h/1h/0h/1/*)#7lqhlmnw " ,
1077
+ "wpkh (tprv8ZgxMBicQKsPeRBCAfUGsZhyHy9dwWyPqhSJmaMnMJQWWtt8L2SkTeHaiF82CUCGtiTiHAs3cMkjdKckGKiCWeYtvMPF1jDTWYTryRMicpx/86h/1h/0h/0/*)#ymr4jlz6 " ,
1078
+ "wpkh (tprv8ZgxMBicQKsPeRBCAfUGsZhyHy9dwWyPqhSJmaMnMJQWWtt8L2SkTeHaiF82CUCGtiTiHAs3cMkjdKckGKiCWeYtvMPF1jDTWYTryRMicpx/86h/1h/0h/1/*)#40x502jz " ,
1079
1079
) . unwrap ( ) ;
1080
- cl. get_new_address ( None , Some ( json:: AddressType :: Bech32m ) ) . unwrap ( ) ;
1080
+
1081
+ let add = cl. get_new_address ( None , Some ( json:: AddressType :: Bech32 ) ) . unwrap ( ) ;
1082
+ assert_eq ! ( add, Address :: from_str( "bcrt1q7crcza94drr00skmu5x0n00rhmwnthde2frhwk" ) . unwrap( ) ) ;
1081
1083
}
0 commit comments