Merge pull request #4731 from nymtech/chore/1.80-lints

chore: fix 1.80 lint issues
This commit is contained in:
Jędrzej Stuczyński
2024-07-26 11:51:23 +01:00
committed by GitHub
14 changed files with 37 additions and 26 deletions
Generated
+1
View File
@@ -9439,6 +9439,7 @@ dependencies = [
name = "wasm-utils"
version = "0.1.0"
dependencies = [
"console_error_panic_hook",
"futures",
"getrandom 0.2.15",
"gloo-net",
@@ -1,6 +1,11 @@
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
// TEMPORARY WORKAROUND:
// those features are expected as the below should only get activated whenever
// the corresponding features in tendermint-rpc are enabled transitively
#![allow(unexpected_cfgs)]
use crate::nyxd::cosmwasm_client::client_traits::SigningCosmWasmClient;
use crate::nyxd::error::NyxdError;
use crate::nyxd::{Config, GasPrice, Hash, Height};
@@ -1,6 +1,11 @@
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
// TEMPORARY WORKAROUND:
// those features are expected as the below should only get activated whenever
// the corresponding features in tendermint-rpc are enabled transitively
#![allow(unexpected_cfgs)]
use crate::nyxd::contract_traits::{NymContractsProvider, TypedNymContracts};
use crate::nyxd::cosmwasm_client::types::{
ChangeAdminResult, ContractCodeId, ExecuteResult, InstantiateOptions, InstantiateResult,
@@ -1,6 +1,11 @@
// Copyright 2023 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
// TEMPORARY WORKAROUND:
// those features are expected as the below should only get activated whenever
// the corresponding features in tendermint-rpc are enabled transitively
#![allow(unexpected_cfgs)]
use async_trait::async_trait;
use cosmrs::tendermint::{self, abci, block::Height, evidence::Evidence, Genesis, Hash};
use serde::{de::DeserializeOwned, Serialize};
-1
View File
@@ -44,7 +44,6 @@ pub enum NymTopologyError {
PayloadBuilder,
#[error("Outfox: {0}")]
#[cfg(feature = "outfox")]
Outfox(#[from] nym_sphinx_types::OutfoxError),
#[error("{0}")]
@@ -7,6 +7,7 @@ use nym_sphinx_routing::SphinxRouteMaker;
use nym_sphinx_types::Node;
use rand::{CryptoRng, Rng};
#[allow(dead_code)]
pub struct NymTopologyRouteProvider<R> {
rng: R,
inner: NymTopology,
+3 -1
View File
@@ -17,6 +17,8 @@ gloo-utils = { workspace = true }
gloo-net = { workspace = true, features = ["websocket"], optional = true }
#gloo-net = { path = "../../../../gloo/crates/net", features = ["websocket"], optional = true }
console_error_panic_hook = { workspace = true, optional = true }
# we don't want entire tokio-tungstenite, tungstenite itself is just fine - we just want message and error enums
[dependencies.tungstenite]
workspace = true
@@ -28,7 +30,7 @@ workspace = true
optional = true
[features]
default = ["sleep"]
default = ["sleep", "console_error_panic_hook"]
sleep = ["web-sys", "web-sys/Window"]
websocket = [
"getrandom",
+1
View File
@@ -20,6 +20,7 @@ impl<R: RngCore + CryptoRng> DkgController<R> {
/// - BTE public key (alongside the proof of discrete log)
/// - ed25519 public key
/// - announce address to be used by clients for obtaining credentials
///
/// Upon successful registration, the node will receive a unique "NodeIndex"
/// which is the x-coordinate of the to be derived keys.
///
+1 -8
View File
@@ -4,7 +4,6 @@
use crate::coconut::storage::models::{EpochCredentials, IssuedCredential};
use crate::support::storage::manager::StorageManager;
use nym_coconut_dkg_common::types::EpochId;
use thiserror::Error;
#[async_trait]
pub trait CoconutStorageManagerExt {
@@ -23,6 +22,7 @@ pub trait CoconutStorageManagerExt {
/// # Arguments
///
/// * `epoch_id`: Id of the (coconut) epoch in question.
#[allow(dead_code)]
async fn create_epoch_credentials_entry(&self, epoch_id: EpochId) -> Result<(), sqlx::Error>;
/// Update the EpochCredentials by incrementing the total number of issued credentials,
@@ -361,10 +361,3 @@ impl CoconutStorageManagerExt for StorageManager {
Ok(())
}
}
#[derive(Debug, Error)]
#[error("tried to store an invalid nonce. the received value is {got} while current is {current}. expected {current} + 1")]
pub struct UnexpectedNonce {
current: u32,
got: u32,
}
+3 -3
View File
@@ -33,12 +33,12 @@ pub fn pseudorandom_account(rng: &mut ChaCha20Rng) -> AccountId {
AccountId::new("n", &dummy_account_key_hash).unwrap()
}
pub fn dealer_fixture(mut rng: &mut ChaCha20Rng, id: NodeIndex) -> DealerDetails {
pub fn dealer_fixture(rng: &mut ChaCha20Rng, id: NodeIndex) -> DealerDetails {
// we might possibly need that private key later on
let keypair = DkgKeyPair::new(dkg::params(), &mut rng);
let keypair = DkgKeyPair::new(dkg::params(), rng.clone());
let addr = pseudorandom_account(rng);
let identity_keypair = identity::KeyPair::new(&mut rng);
let identity_keypair = identity::KeyPair::new(rng);
let bte_public_key_with_proof = bs58::encode(&keypair.public_key().to_bytes()).into_string();
let port = 8080 + id;
+7 -7
View File
@@ -63,15 +63,15 @@ impl RewardedSetUpdater {
/// 2. it queries the mixnet contract to check the current `EpochState` in order to figure out whether
/// a different nym-api has already started epoch transition (not yet applicable)
/// 3. it sends a `BeginEpochTransition` message to the mixnet contract causing the following to happen:
/// - if successful, the address of the this validator is going to be saved as being responsible for progressing this epoch.
/// What it means in practice is that once we have multiple instances of nym-api running,
/// only this one will try to perform the rest of the actions. It will also allow it to
/// more easily recover in case of crashes.
/// - if successful, the address of this validator is going to be saved as being responsible for progressing this epoch.
/// What it means in practice is that once we have multiple instances of nym-api running,
/// only this one will try to perform the rest of the actions. It will also allow it to
/// more easily recover in case of crashes.
/// - the `EpochState` changes to `Rewarding`, meaning the nym-api will now be allowed to send
/// `RewardMixnode` transactions. However, it's not going to be able anything else like `ReconcileEpochEvents`
/// until that is done.
/// `RewardMixnode` transactions. However, it's not going to be able anything else like `ReconcileEpochEvents`
/// until that is done.
/// - ability to send transactions (by other users) that get resolved once given epoch/interval rolls over,
/// such as `BondMixnode` or `DelegateToMixnode` will temporarily be frozen until the entire procedure is finished.
/// such as `BondMixnode` or `DelegateToMixnode` will temporarily be frozen until the entire procedure is finished.
/// 4. it obtains the current rewarded set and for each node in there (**SORTED BY MIX_ID!!**),
/// it sends (in a single batch) `RewardMixnode` message with the measured performance.
/// Once the final message gets executed, the mixnet contract automatically transitions
+1
View File
@@ -272,6 +272,7 @@ impl WalletStateInner {
/// 1. from the configuration file
/// 2. provided remotely
/// 3. hardcoded fallback
///
/// The format is the config backend format, which is flat due to serialization preference.
pub fn get_config_validator_entries(
&self,
@@ -7,8 +7,8 @@
///
/// Wallet
/// - Login
/// -- Account
/// --- Mnemonic
/// -- Account
/// --- Mnemonic
pub(crate) use crate::wallet_storage::account_data::StoredLogin;
pub(crate) use crate::wallet_storage::password::{AccountId, LoginId, UserPassword};
+2 -4
View File
@@ -610,8 +610,7 @@ where
///
/// - If the client is already registered with a gateway, use that gateway.
/// - If no gateway is registered, but there is an existing configuration and key, use that.
/// - If no gateway is registered, and there is no pre-existing configuration or key, try to
/// register a new gateway.
/// - If no gateway is registered, and there is no pre-existing configuration or key, try to register a new gateway.
///
/// # Example
///
@@ -691,8 +690,7 @@ where
///
/// - If the client is already registered with a gateway, use that gateway.
/// - If no gateway is registered, but there is an existing configuration and key, use that.
/// - If no gateway is registered, and there is no pre-existing configuration or key, try to
/// register a new gateway.
/// - If no gateway is registered, and there is no pre-existing configuration or key, try to register a new gateway.
///
/// # Example
///