Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix remote RPC wallet commands #1766

Merged
merged 8 commits into from
Jul 28, 2023
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