From 4d9489aeb1f12fe17da46ee9ef6dc09f1ad95a6e Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Fri, 11 Jan 2019 15:37:52 -0700 Subject: [PATCH] Use RPC endpoint of the provided network entrypoint rather than searching for the leader --- wallet/src/main.rs | 1 + wallet/src/wallet.rs | 18 +++++++++++------- wallet/tests/pay.rs | 5 +++++ wallet/tests/request_airdrop.rs | 1 + 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/wallet/src/main.rs b/wallet/src/main.rs index 56a60fb76a..4dbb144004 100644 --- a/wallet/src/main.rs +++ b/wallet/src/main.rs @@ -52,6 +52,7 @@ pub fn parse_args(matches: &ArgMatches<'_>) -> Result, pub drone_port: Option, pub rpc_client: Option, + pub rpc_port: Option, } impl Default for WalletConfig { @@ -104,6 +104,7 @@ impl Default for WalletConfig { proxy: None, drone_port: None, rpc_client: None, + rpc_port: None, } } } @@ -116,7 +117,9 @@ impl WalletConfig { drone_addr } - pub fn rpc_addr(&self, rpc_addr: SocketAddr) -> String { + pub fn rpc_addr(&self) -> String { + let mut rpc_addr = self.network; + rpc_addr.set_port(self.rpc_port.unwrap_or(RPC_PORT)); let rpc_addr_str = get_rpc_request_str(rpc_addr); self.proxy.clone().unwrap_or(rpc_addr_str) } @@ -321,8 +324,7 @@ pub fn process_command(config: &WalletConfig) -> Result