File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -205,19 +205,28 @@ mod test {
205
205
} ;
206
206
use electrum_client:: ElectrumApi ;
207
207
use lazy_static:: lazy_static;
208
+ use std:: env;
208
209
use std:: sync:: { Mutex , Once } ;
209
210
use std:: time:: Duration ;
210
211
211
212
lazy_static ! {
212
213
static ref BITCOIND : BitcoinD = {
213
- let bitcoind_exe =
214
- bitcoind:: downloaded_exe_path( ) . expect( "bitcoind version feature must be enabled" ) ;
214
+ let bitcoind_exe = env:: var( "BITCOIND_EXE" )
215
+ . ok( )
216
+ . or( bitcoind:: downloaded_exe_path( ) . ok( ) )
217
+ . expect(
218
+ "you should provide env var BITCOIND_EXE or specifiy a bitcoind version feature" ,
219
+ ) ;
215
220
let conf = bitcoind:: Conf :: default ( ) ;
216
221
BitcoinD :: with_conf( bitcoind_exe, & conf) . unwrap( )
217
222
} ;
218
223
static ref ELECTRSD : ElectrsD = {
219
- let electrs_exe =
220
- electrsd:: downloaded_exe_path( ) . expect( "electrs version feature must be enabled" ) ;
224
+ let electrs_exe = env:: var( "ELECTRS_EXE" )
225
+ . ok( )
226
+ . or( electrsd:: downloaded_exe_path( ) )
227
+ . expect(
228
+ "you should provide env var ELECTRS_EXE or specifiy a electrsd version feature" ,
229
+ ) ;
221
230
let mut conf = electrsd:: Conf :: default ( ) ;
222
231
conf. http_enabled = true ;
223
232
ElectrsD :: with_conf( electrs_exe, & BITCOIND , & conf) . unwrap( )
You can’t perform that action at this time.
0 commit comments