6
6
//! Utility to run a regtest bitcoind process, useful in integration testing environment
7
7
//!
8
8
//! ```no_run
9
- //! use bitcoincore_rpc ::RpcApi;
9
+ //! use core_rpc ::RpcApi;
10
10
//! let bitcoind = bitcoind::BitcoinD::new("/usr/local/bin/bitcoind").unwrap();
11
11
//! assert_eq!(0, bitcoind.client.get_blockchain_info().unwrap().blocks);
12
12
//! ```
@@ -24,7 +24,7 @@ use std::thread;
24
24
use std:: time:: Duration ;
25
25
use tempfile:: TempDir ;
26
26
27
- pub extern crate bitcoincore_rpc;
27
+ pub extern crate core_rpc as bitcoincore_rpc;
28
28
pub extern crate tempfile;
29
29
30
30
/// Struct representing the bitcoind process with related information
@@ -181,7 +181,7 @@ impl BitcoinD {
181
181
let client = loop {
182
182
thread:: sleep ( Duration :: from_millis ( 500 ) ) ;
183
183
assert ! ( process. stderr. is_none( ) ) ;
184
- let client_result = Client :: new ( rpc_url. clone ( ) , Auth :: CookieFile ( cookie_file. clone ( ) ) ) ;
184
+ let client_result = Client :: new ( & rpc_url, Auth :: CookieFile ( cookie_file. clone ( ) ) ) ;
185
185
if let Ok ( client_base) = client_result {
186
186
// RpcApi has get_blockchain_info method, however being generic with `Value` allows
187
187
// to be compatible with different version, in the end we are only interested if
@@ -190,7 +190,7 @@ impl BitcoinD {
190
190
client_base
191
191
. create_wallet ( "default" , None , None , None , None )
192
192
. unwrap ( ) ;
193
- break Client :: new ( node_url_default, Auth :: CookieFile ( cookie_file. clone ( ) ) )
193
+ break Client :: new ( & node_url_default, Auth :: CookieFile ( cookie_file. clone ( ) ) )
194
194
. unwrap ( ) ;
195
195
}
196
196
}
@@ -244,7 +244,7 @@ impl BitcoinD {
244
244
. client
245
245
. create_wallet ( wallet. as_ref ( ) , None , None , None , None ) ?;
246
246
Ok ( Client :: new (
247
- self . rpc_url_with_wallet ( wallet) ,
247
+ & self . rpc_url_with_wallet ( wallet) ,
248
248
Auth :: CookieFile ( self . params . cookie_file . clone ( ) ) ,
249
249
) ?)
250
250
}
0 commit comments