From 97804d1837e3b556b9881947062833292adf90df Mon Sep 17 00:00:00 2001 From: Carlos Alaniz Date: Fri, 28 Jul 2023 10:30:41 -0500 Subject: [PATCH] Fix remote RPC wallet commands (#1766) --- src/options.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/options.rs b/src/options.rs index a8853ae7a9..20841e911b 100644 --- a/src/options.rs +++ b/src/options.rs @@ -82,13 +82,15 @@ impl Options { } pub(crate) fn rpc_url(&self) -> String { - self.rpc_url.clone().unwrap_or_else(|| { + if let Some(rpc_url) = &self.rpc_url { + format!("{rpc_url}/wallet/{}", self.wallet) + } else { format!( "127.0.0.1:{}/wallet/{}", self.chain().default_rpc_port(), self.wallet ) - }) + } } pub(crate) fn cookie_file(&self) -> Result { @@ -285,7 +287,7 @@ mod tests { .unwrap() .options .rpc_url(), - "127.0.0.1:1234" + "127.0.0.1:1234/wallet/ord" ); }