chore: clippy for 1.86 (#5685)
* chore: clippy for 1.86 * clippy inside wallet
This commit is contained in:
committed by
GitHub
parent
257e36ddcb
commit
12026305d5
@@ -219,7 +219,7 @@ impl Epoch {
|
||||
EpochState::VerificationKeyFinalization { .. } => {
|
||||
time_configuration.verification_key_finalization_time_secs
|
||||
}
|
||||
EpochState::InProgress { .. } => 0,
|
||||
EpochState::InProgress => 0,
|
||||
};
|
||||
finish += adding;
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ pub enum NodeType {
|
||||
|
||||
impl NodeType {
|
||||
pub fn is_mixnode(&self) -> bool {
|
||||
matches!(self, NodeType::Mixnode { .. })
|
||||
matches!(self, NodeType::Mixnode)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -403,7 +403,7 @@ pub fn issue(
|
||||
/// * `sk_user` - Secret key of the user.
|
||||
/// * `blind_signature` - Blinded signature received from the authority.
|
||||
/// * `req_info` - Information associated with the request, including the joined commitment hash,
|
||||
/// private attributes openings, v, and expiration date.
|
||||
/// private attributes openings, v, and expiration date.
|
||||
///
|
||||
/// # Returns
|
||||
///
|
||||
|
||||
@@ -171,6 +171,7 @@ pub fn is_cover(data: &[u8]) -> bool {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use std::iter::repeat_n;
|
||||
|
||||
#[test]
|
||||
fn is_cover_works_for_identical_input() {
|
||||
@@ -182,7 +183,7 @@ mod tests {
|
||||
let input: Vec<_> = LOOP_COVER_MESSAGE_PAYLOAD
|
||||
.iter()
|
||||
.cloned()
|
||||
.chain(std::iter::repeat(42).take(100))
|
||||
.chain(repeat_n(42, 100))
|
||||
.collect();
|
||||
assert!(is_cover(&input))
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ impl NymMessage {
|
||||
bytes
|
||||
.into_iter()
|
||||
.chain(std::iter::once(1u8))
|
||||
.chain(std::iter::repeat(0u8).take(space_left))
|
||||
.chain(std::iter::repeat_n(0u8, space_left))
|
||||
.collect::<Vec<_>>()
|
||||
.into()
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ pub trait FragmentPreparer {
|
||||
/// - compute SURB_ACK
|
||||
/// - generate (x, g^x)
|
||||
/// - obtain key k from the reply-surb which was computed as follows:
|
||||
/// k = KDF(remote encryption key ^ x) this is equivalent to KDF( dh(remote, x) )
|
||||
/// k = KDF(remote encryption key ^ x) this is equivalent to KDF( dh(remote, x) )
|
||||
/// - compute v_b = AES-128-CTR(k, serialized_fragment)
|
||||
/// - compute vk_b = H(k) || v_b
|
||||
/// - compute sphinx_plaintext = SURB_ACK || H(k) || v_b
|
||||
|
||||
Generated
+8
-8
@@ -667,9 +667,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "deranged"
|
||||
version = "0.3.11"
|
||||
version = "0.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4"
|
||||
checksum = "28cfac68e08048ae1883171632c2aef3ebc555621ae56fbccce1cbf22dd7f058"
|
||||
dependencies = [
|
||||
"powerfmt",
|
||||
]
|
||||
@@ -1851,9 +1851,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "time"
|
||||
version = "0.3.39"
|
||||
version = "0.3.41"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dad298b01a40a23aac4580b67e3dbedb7cc8402f3592d7f49469de2ea4aecdd8"
|
||||
checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40"
|
||||
dependencies = [
|
||||
"deranged",
|
||||
"itoa",
|
||||
@@ -1868,15 +1868,15 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "time-core"
|
||||
version = "0.1.3"
|
||||
version = "0.1.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "765c97a5b985b7c11d7bc27fa927dc4fe6af3a6dfb021d28deb60d3bf51e76ef"
|
||||
checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c"
|
||||
|
||||
[[package]]
|
||||
name = "time-macros"
|
||||
version = "0.2.20"
|
||||
version = "0.2.22"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e8093bc3e81c3bc5f7879de09619d06c9a5a5e45ca44dfeeb7225bae38005c5c"
|
||||
checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49"
|
||||
dependencies = [
|
||||
"num-conv",
|
||||
"time-core",
|
||||
|
||||
Generated
+393
-124
File diff suppressed because it is too large
Load Diff
@@ -12,10 +12,7 @@ use nym_validator_client::nyxd::contract_traits::MixnetQueryClient;
|
||||
use nym_wallet_types::app::AppEnv;
|
||||
|
||||
fn get_env_as_option(key: &str) -> Option<String> {
|
||||
match ::std::env::var(key) {
|
||||
Ok(res) => Some(res),
|
||||
Err(_e) => None,
|
||||
}
|
||||
::std::env::var(key).ok()
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// Copyright 2022 - Nym Technologies SA <contact@nymtech.net>
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#![allow(clippy::doc_overindented_list_items)]
|
||||
|
||||
/// The wallet storage file contains a set of logins, each with an associated login ID and an
|
||||
/// encrypted field. Once decrypted, each login contains either an account, or a set of accounts.
|
||||
/// One difference is that the latter have an associated account ID.
|
||||
@@ -2151,7 +2153,7 @@ mod tests {
|
||||
assert!(matches!(acc2, StoredLogin::Mnemonic(_)));
|
||||
|
||||
let expected_acc1 = bip39::Mnemonic::from_str("country mean universe text phone begin deputy reject result good cram illness common cluster proud swamp digital patrol spread bar face december base kick").unwrap();
|
||||
let expected_acc2 = bip39::Mnemonic::from_str("home mansion start quiz dress decide hint second dragon sunny juice always steak real minimum art rival skin draw total pulp foot goddess agent").unwrap();
|
||||
let expected_acc2 = bip39::Mnemonic::from_str("home mansion start quiz dress decide hint second dragon sunny juice always steak real minimum art rival skin draw total pulp foot goddess agent").unwrap();
|
||||
|
||||
assert_eq!(
|
||||
acc1.as_mnemonic_account().unwrap().mnemonic(),
|
||||
|
||||
Reference in New Issue
Block a user