@@ -58,21 +58,18 @@ impl BitcoinCoreController {
58
58
. arg ( "-server=1" )
59
59
. arg ( "-listenonion=0" )
60
60
. arg ( "-rpcbind=127.0.0.1" )
61
- . arg ( & format ! ( "-port={}" , self . config. burnchain. peer_port) )
62
- . arg ( & format ! (
63
- "-datadir={}" ,
64
- self . config. get_burnchain_path_str( )
65
- ) )
66
- . arg ( & format ! ( "-rpcport={}" , self . config. burnchain. rpc_port) ) ;
61
+ . arg ( format ! ( "-port={}" , self . config. burnchain. peer_port) )
62
+ . arg ( format ! ( "-datadir={}" , self . config. get_burnchain_path_str( ) ) )
63
+ . arg ( format ! ( "-rpcport={}" , self . config. burnchain. rpc_port) ) ;
67
64
68
65
match (
69
66
& self . config . burnchain . username ,
70
67
& self . config . burnchain . password ,
71
68
) {
72
69
( Some ( username) , Some ( password) ) => {
73
70
command
74
- . arg ( & format ! ( "-rpcuser={}" , username ) )
75
- . arg ( & format ! ( "-rpcpassword={}" , password ) ) ;
71
+ . arg ( format ! ( "-rpcuser={username}" ) )
72
+ . arg ( format ! ( "-rpcpassword={password}" ) ) ;
76
73
}
77
74
_ => { }
78
75
}
@@ -81,7 +78,7 @@ impl BitcoinCoreController {
81
78
82
79
let mut process = match command. spawn ( ) {
83
80
Ok ( child) => child,
84
- Err ( e) => return Err ( BitcoinCoreError :: SpawnFailed ( format ! ( "{:?}" , e ) ) ) ,
81
+ Err ( e) => return Err ( BitcoinCoreError :: SpawnFailed ( format ! ( "{e :?}" ) ) ) ,
85
82
} ;
86
83
87
84
let mut out_reader = BufReader :: new ( process. stdout . take ( ) . unwrap ( ) ) ;
@@ -111,14 +108,25 @@ impl BitcoinCoreController {
111
108
command
112
109
. stdout ( Stdio :: piped ( ) )
113
110
. arg ( "-rpcconnect=127.0.0.1" )
114
- . arg ( "-rpcport=8332" )
115
- . arg ( "-rpcuser=neon-tester" )
116
- . arg ( "-rpcpassword=neon-tester-pass" )
117
- . arg ( "stop" ) ;
111
+ . arg ( format ! ( "-rpcport={}" , self . config. burnchain. rpc_port) ) ;
112
+
113
+ match (
114
+ & self . config . burnchain . username ,
115
+ & self . config . burnchain . password ,
116
+ ) {
117
+ ( Some ( username) , Some ( password) ) => {
118
+ command
119
+ . arg ( format ! ( "-rpcuser={username}" ) )
120
+ . arg ( format ! ( "-rpcpassword={password}" ) ) ;
121
+ }
122
+ _ => { }
123
+ }
124
+
125
+ command. arg ( "stop" ) ;
118
126
119
127
let mut process = match command. spawn ( ) {
120
128
Ok ( child) => child,
121
- Err ( e) => return Err ( BitcoinCoreError :: SpawnFailed ( format ! ( "{:?}" , e ) ) ) ,
129
+ Err ( e) => return Err ( BitcoinCoreError :: SpawnFailed ( format ! ( "{e :?}" ) ) ) ,
122
130
} ;
123
131
124
132
let mut out_reader = BufReader :: new ( process. stdout . take ( ) . unwrap ( ) ) ;
@@ -127,7 +135,7 @@ impl BitcoinCoreController {
127
135
if bytes_read == 0 {
128
136
break ;
129
137
}
130
- eprintln ! ( "{}" , & line ) ;
138
+ eprintln ! ( "{line}" ) ;
131
139
}
132
140
}
133
141
Ok ( ( ) )
0 commit comments