@@ -20,7 +20,7 @@ use hmac::{Hmac, Mac as _};
2020use rand:: { Rng as _, RngCore as _} ;
2121use secp:: Scalar ;
2222use sha2:: Sha256 ;
23- use tempfile:: { TempDir , tempdir } ;
23+ use tempfile:: TempDir ;
2424use tokio:: net:: TcpListener ;
2525
2626/// Bitcoin regtest environment manager
@@ -31,7 +31,6 @@ pub struct TestEnv {
3131 delay : Duration ,
3232 bdk_electrum_client : BdkElectrumClient < Client > ,
3333 ctx : Secp256k1 < All > ,
34- // _permit: Permit,
3534 explorer_process : Option < std:: process:: Child > ,
3635 container_name : Option < String > ,
3736 explorer_port : Option < u16 > ,
@@ -192,11 +191,6 @@ impl TestEnv {
192191
193192 /// create environment with automatic downloads
194193 pub fn new_with_conf ( config : Config ) -> Result < Self > {
195- // let permit = SEMAPHORE.acquire(); // have testenvs single threaded because of bitcoind
196- // and electrs references.
197- let tmp_dir = tempdir ( ) . expect ( "failed to create temporary directory" ) ;
198- std:: env:: set_current_dir ( tmp_dir. path ( ) ) . expect ( "failed to set current directory" ) ;
199-
200194 // Try to start bitcoind (from environment or downloads)
201195 tracing:: info!( "Starting bitcoind..." ) ;
202196 // rpcauth for each bitcoind and save the pwd
@@ -245,15 +239,13 @@ impl TestEnv {
245239 ) ?;
246240 let bdk_electrum_client = BdkElectrumClient :: new ( client) ;
247241
248- // permit will be dropped when TestEnv is dropped
249242 let test_env = Self {
250243 bitcoind,
251244 electrsd,
252245 timeout : config. timeout ,
253246 delay : config. delay ,
254247 bdk_electrum_client,
255248 ctx : Secp256k1 :: new ( ) ,
256- // _permit: permit,
257249 explorer_process : None ,
258250 container_name : None ,
259251 explorer_port : None ,
0 commit comments