mirror of
https://github.com/jwinterm/grin-wallet.git
synced 2026-10-17 07:11:36 +02:00
Clippy easy wins 1 (#596)
This commit is contained in:
@@ -189,7 +189,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()),
|
||||
test_mode,
|
||||
);
|
||||
|
||||
@@ -337,38 +337,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
|
||||
|
||||
Reference in New Issue
Block a user