File tree Expand file tree Collapse file tree 5 files changed +9
-9
lines changed Expand file tree Collapse file tree 5 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 1313// See the License for the specific language governing permissions and
1414// limitations under the License.
1515
16- use std:: { net :: SocketAddr , path:: PathBuf } ;
16+ use std:: path:: PathBuf ;
1717
1818use clap:: Parser ;
1919use common:: chain:: config:: ChainType ;
@@ -42,7 +42,7 @@ pub struct WalletCliArgs {
4242
4343 /// Optional RPC address
4444 #[ clap( long) ]
45- pub rpc_address : Option < SocketAddr > ,
45+ pub rpc_address : Option < String > ,
4646
4747 /// Path to the RPC cookie file. If not set, the value is read from the default cookie file location.
4848 #[ clap( long) ]
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ mod repl;
2222
2323type CliController = wallet_controller:: RpcController < wallet:: wallet_events:: WalletEventsNoOp > ;
2424
25- use std:: { net :: SocketAddr , str :: FromStr , sync:: Arc } ;
25+ use std:: sync:: Arc ;
2626
2727use cli_event_loop:: Event ;
2828use commands:: WalletCommand ;
@@ -80,7 +80,7 @@ pub async fn run(
8080 . unwrap_or_else ( || Arc :: new ( common:: chain:: config:: Builder :: new ( chain_type) . build ( ) ) ) ;
8181
8282 // TODO: Use the constant with the node
83- let default_http_rpc_addr = || SocketAddr :: from_str ( "127.0.0.1:3030" ) . expect ( "Can't fail" ) ;
83+ let default_http_rpc_addr = || "127.0.0.1:3030" . to_owned ( ) ;
8484 let rpc_address = rpc_address. unwrap_or_else ( default_http_rpc_addr) ;
8585
8686 let rpc_auth = match ( rpc_cookie_file, rpc_username, rpc_password) {
Original file line number Diff line number Diff line change @@ -310,7 +310,7 @@ impl CliTestFramework {
310310 network : Network :: Regtest ,
311311 wallet_file : None ,
312312 start_staking : false ,
313- rpc_address : Some ( self . rpc_address ) ,
313+ rpc_address : Some ( self . rpc_address . to_string ( ) ) ,
314314 rpc_cookie_file : None ,
315315 rpc_username : Some ( RPC_USERNAME . to_owned ( ) ) ,
316316 rpc_password : Some ( RPC_PASSWORD . to_owned ( ) ) ,
Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ use handles_client::WalletHandlesClientError;
1919use mempool:: MempoolHandle ;
2020use p2p:: P2pHandle ;
2121use rpc:: RpcAuthData ;
22- use std:: net:: SocketAddr ;
2322
2423use rpc_client:: NodeRpcError ;
2524
@@ -28,10 +27,10 @@ pub mod node_traits;
2827pub mod rpc_client;
2928
3029pub async fn make_rpc_client (
31- remote_socket_address : SocketAddr ,
30+ remote_socket_address : String ,
3231 rpc_auth : RpcAuthData ,
3332) -> Result < rpc_client:: NodeRpcClient , NodeRpcError > {
34- rpc_client:: NodeRpcClient :: new ( remote_socket_address. to_string ( ) , rpc_auth) . await
33+ rpc_client:: NodeRpcClient :: new ( remote_socket_address, rpc_auth) . await
3534}
3635
3736pub async fn make_handles_client (
Original file line number Diff line number Diff line change @@ -237,7 +237,8 @@ async fn node_rpc_communication() {
237237 manager_task_handle,
238238 ) = start_subsystems ( chain_config. clone ( ) , "127.0.0.1:0" . to_string ( ) ) . await ;
239239
240- let rpc_client = make_rpc_client ( rpc_bind_address, RpcAuthData :: None ) . await . unwrap ( ) ;
240+ let rpc_client =
241+ make_rpc_client ( rpc_bind_address. to_string ( ) , RpcAuthData :: None ) . await . unwrap ( ) ;
241242
242243 test_wallet_node_communication ( chain_config, chainstate, rpc_client) . await ;
243244
You can’t perform that action at this time.
0 commit comments