Skip to content

Commit 5176736

Browse files
committed
common+lexe-ln: Fix comment, minor adjustments
1 parent 35b5269 commit 5176736

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

common/src/cli.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use crate::enclave::{self, MachineId};
2323
pub const DEFAULT_BACKEND_URL: &str = "http://127.0.0.1:3030";
2424
pub const DEFAULT_RUNNER_URL: &str = "http://127.0.0.1:5050";
2525

26-
#[derive(Clone, Debug, PartialEq, Eq, FromArgs)]
26+
#[derive(Clone, Debug, Eq, PartialEq, FromArgs)]
2727
#[argh(subcommand)]
2828
pub enum NodeCommand {
2929
Run(RunArgs),
@@ -126,7 +126,7 @@ pub struct RunArgs {
126126
#[argh(option)]
127127
pub peer_port: Option<Port>,
128128

129-
/// testnet or mainnet. Defaults to testnet.
129+
/// bitcoin, testnet, regtest, or signet. Defaults to testnet.
130130
#[argh(option, default = "Network::default()")]
131131
pub network: Network,
132132

@@ -354,11 +354,9 @@ impl BitcoindRpcInfo {
354354
/// Returns a base64 encoding of "<user>:<pass>" required by the BitcoinD
355355
/// RPC client.
356356
pub fn base64_credentials(&self) -> String {
357-
base64::encode(format!(
358-
"{}:{}",
359-
self.username.clone(),
360-
self.password.clone(),
361-
))
357+
let username = &self.username;
358+
let password = &self.password;
359+
base64::encode(format!("{username}:{password}"))
362360
}
363361
}
364362

lexe-ln/src/bitcoind/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ impl LexeBitcoind {
4545
) -> anyhow::Result<Self> {
4646
debug!(%network, "Initializing bitcoind client");
4747

48-
let http_endpoint = HttpEndpoint::for_host(bitcoind_rpc.host.clone())
49-
.with_port(bitcoind_rpc.port);
5048
let credentials = bitcoind_rpc.base64_credentials();
49+
let http_endpoint = HttpEndpoint::for_host(bitcoind_rpc.host)
50+
.with_port(bitcoind_rpc.port);
5151
let rpc_client = RpcClient::new(&credentials, http_endpoint)
5252
.context("Could not initialize RPC client")?;
5353
let rpc_client = Arc::new(rpc_client);

0 commit comments

Comments
 (0)