@@ -2,11 +2,8 @@ use bdk_electrum::electrum_client::Client;
22use bdk_electrum:: { electrum_client, BdkElectrumClient } ;
33use bdk_wallet:: bitcoin:: { Amount , FeeRate } ;
44use bdk_wallet:: { KeychainKind , SignOptions , Wallet } ;
5- use electrsd:: bitcoind:: bitcoincore_rpc:: {
6- bitcoin:: { Address , Network } ,
7- RpcApi ,
8- } ;
9- use electrsd:: bitcoind:: BitcoinD ;
5+ use electrsd:: corepc_node:: client:: bitcoin:: { Address , Network } ;
6+ use electrsd:: corepc_node:: Node ;
107use electrsd:: electrum_client:: ElectrumApi ;
118use electrsd:: ElectrsD ;
129use std:: str:: FromStr ;
@@ -15,20 +12,20 @@ use std::time::Duration;
1512/// The environment to run a single test, while many of them can run in parallel.
1613pub struct RegTestEnv {
1714 /// Instance of the bitcoin core daemon
18- bitcoind : BitcoinD ,
15+ bitcoind : Node ,
1916 /// Instance of the electrs electrum server
2017 electrsd : ElectrsD ,
2118}
2219
2320impl RegTestEnv {
2421 /// set up local bitcoind and electrs instances in regtest mode
2522 pub fn new ( ) -> Self {
26- let mut bitcoind_conf = electrsd:: bitcoind :: Conf :: default ( ) ;
27- bitcoind_conf. p2p = electrsd:: bitcoind :: P2P :: Yes ;
23+ let mut bitcoind_conf = electrsd:: corepc_node :: Conf :: default ( ) ;
24+ bitcoind_conf. p2p = electrsd:: corepc_node :: P2P :: Yes ;
2825
29- let bitcoind_exe = electrsd:: bitcoind :: downloaded_exe_path ( )
26+ let bitcoind_exe = electrsd:: corepc_node :: downloaded_exe_path ( )
3027 . expect ( "We should always have downloaded path" ) ;
31- let bitcoind = BitcoinD :: with_conf ( bitcoind_exe, & bitcoind_conf) . unwrap ( ) ;
28+ let bitcoind = Node :: with_conf ( bitcoind_exe, & bitcoind_conf) . unwrap ( ) ;
3229
3330 let mut elect_conf = electrsd:: Conf :: default ( ) ;
3431 elect_conf. view_stderr = false ; // setting this to true will lead to very verbose logging
@@ -116,7 +113,7 @@ impl RegTestEnv {
116113
117114 self . bitcoind
118115 . client
119- . generate_to_address ( blocks as u64 , address)
116+ . generate_to_address ( blocks, address)
120117 . unwrap ( ) ;
121118
122119 let header = loop {
@@ -127,7 +124,12 @@ impl RegTestEnv {
127124 }
128125 } ;
129126
130- assert_eq ! ( header. height, old_height + blocks) ;
127+ assert ! (
128+ header. height >= old_height + blocks,
129+ "{} >= {}" ,
130+ header. height,
131+ old_height + blocks
132+ ) ;
131133 }
132134}
133135
0 commit comments