Skip to content

Commit

Permalink
rebase 5.3.X [PATCH 085/142] Clippy easy wins 1 (mimblewimble#596)
Browse files Browse the repository at this point in the history
  • Loading branch information
bayk committed Aug 1, 2024
1 parent 2cc3ba0 commit 2a9126e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 25 deletions.
2 changes: 1 addition & 1 deletion controller/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ where
config.owner_api_listen_addr().as_str(),
g_args.api_secret.clone(),
g_args.tls_conf.clone(),
config.owner_api_include_foreign.clone(),
config.owner_api_include_foreign,
Some(tor_config.clone()),
)
.map_err(|e| ErrorKind::LibWallet(format!("Unable to start Listener, {}", e)))?;
Expand Down
27 changes: 3 additions & 24 deletions controller/src/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1149,38 +1149,17 @@ pub struct OwnerV3Helpers;
impl OwnerV3Helpers {
/// Checks whether a request is to init the secure API
pub fn is_init_secure_api(val: &serde_json::Value) -> bool {
if let Some(m) = val["method"].as_str() {
match m {
"init_secure_api" => true,
_ => false,
}
} else {
false
}
matches!(val["method"].as_str(), Some("init_secure_api"))
}

/// Checks whether a request is to open the wallet
pub fn is_open_wallet(val: &serde_json::Value) -> bool {
if let Some(m) = val["method"].as_str() {
match m {
"open_wallet" => true,
_ => false,
}
} else {
false
}
matches!(val["method"].as_str(), Some("open_wallet"))
}

/// Checks whether a request is an encrypted request
pub fn is_encrypted_request(val: &serde_json::Value) -> bool {
if let Some(m) = val["method"].as_str() {
match m {
"encrypted_request_v3" => true,
_ => false,
}
} else {
false
}
matches!(val["method"].as_str(), Some("encrypted_request_v3"))
}

/// whether encryption is enabled
Expand Down

0 comments on commit 2a9126e

Please sign in to comment.