Skip to content

Commit

Permalink
Fix remote RPC wallet commands (#1766)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosalaniz authored Jul 28, 2023
1 parent b54e58a commit 97804d1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<PathBuf> {
Expand Down Expand Up @@ -285,7 +287,7 @@ mod tests {
.unwrap()
.options
.rpc_url(),
"127.0.0.1:1234"
"127.0.0.1:1234/wallet/ord"
);
}

Expand Down

0 comments on commit 97804d1

Please sign in to comment.