Skip to content

Commit

Permalink
address clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
juped committed May 14, 2023
1 parent 4b2143c commit 37a56a5
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 17 deletions.
1 change: 0 additions & 1 deletion apps/src/bin/namada-client/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use namada_apps::client::{rpc, tx, utils};
use namada_apps::facade::tendermint::block::Height;
use namada_apps::facade::tendermint_config::net::Address as TendermintAddress;
use namada_apps::facade::tendermint_rpc::{Client, HttpClient};
use namada_apps::wallet::CliWalletUtils;
use tokio::time::sleep;

pub async fn main() -> Result<()> {
Expand Down
2 changes: 1 addition & 1 deletion apps/src/lib/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1696,7 +1696,7 @@ pub mod args {
"base-dir",
DefaultFn(|| match env::var("NAMADA_BASE_DIR") {
Ok(dir) => PathBuf::from(dir),
Err(_) => PathBuf::from(config::get_default_namada_folder()),
Err(_) => config::get_default_namada_folder(),
}),
);
pub const BLOCK_HEIGHT: Arg<BlockHeight> = arg("block-height");
Expand Down
12 changes: 6 additions & 6 deletions apps/src/lib/client/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ pub async fn query_block<C: namada::ledger::queries::Client + Sync>(
/// Query the results of the last committed block
pub async fn query_results<C: namada::ledger::queries::Client + Sync>(
client: &C,
args: args::Query,
_args: args::Query,
) -> Vec<BlockResults> {
unwrap_client_response::<C, Vec<BlockResults>>(
RPC.shell().read_results(client).await,
Expand Down Expand Up @@ -414,7 +414,7 @@ pub async fn query_pinned_balance<
// Extract and print only the specified token from the total
let (_asset_type, balance) =
value_by_address(&balance, token.clone(), epoch);
let token_alias = lookup_alias(wallet, &token);
let token_alias = lookup_alias(wallet, token);
if balance == 0 {
println!(
"Payment address {} was consumed during epoch {}. \
Expand Down Expand Up @@ -1250,7 +1250,7 @@ pub async fn query_withdrawable_tokens<
/// Query PoS bond(s) and unbond(s)
pub async fn query_bonds<C: namada::ledger::queries::Client + Sync>(
client: &C,
wallet: &mut Wallet<CliWalletUtils>,
_wallet: &mut Wallet<CliWalletUtils>,
args: args::QueryBonds,
) -> std::io::Result<()> {
let _epoch = query_and_print_epoch(client).await;
Expand Down Expand Up @@ -1448,7 +1448,7 @@ pub async fn query_and_print_commission_rate<
C: namada::ledger::queries::Client + Sync,
>(
client: &C,
wallet: &mut Wallet<CliWalletUtils>,
_wallet: &mut Wallet<CliWalletUtils>,
args: args::QueryCommissionRate,
) {
let validator = args.validator;
Expand Down Expand Up @@ -1480,7 +1480,7 @@ pub async fn query_and_print_commission_rate<
/// Query PoS slashes
pub async fn query_slashes<C: namada::ledger::queries::Client + Sync>(
client: &C,
wallet: &mut Wallet<CliWalletUtils>,
_wallet: &mut Wallet<CliWalletUtils>,
args: args::QuerySlashes,
) {
let params_key = pos::params_key();
Expand Down Expand Up @@ -1545,7 +1545,7 @@ pub async fn query_slashes<C: namada::ledger::queries::Client + Sync>(

pub async fn query_delegations<C: namada::ledger::queries::Client + Sync>(
client: &C,
wallet: &mut Wallet<CliWalletUtils>,
_wallet: &mut Wallet<CliWalletUtils>,
args: args::QueryDelegations,
) {
let owner = args.owner;
Expand Down
3 changes: 1 addition & 2 deletions apps/src/lib/client/signing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ use namada::ledger::tx;
use namada::ledger::wallet::{Wallet, WalletUtils};
use namada::proto::Tx;
use namada::types::address::Address;
use namada::types::hash::Hash;
use namada::types::key::*;
use namada::types::storage::Epoch;

use crate::cli::{args, Context};
use crate::cli::{args};

/// Find the public key for the given address and try to load the keypair
/// for it from the wallet. Panics if the key cannot be found or loaded.
Expand Down
4 changes: 2 additions & 2 deletions apps/src/lib/client/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use borsh::{BorshDeserialize, BorshSerialize};
use data_encoding::HEXLOWER_PERMISSIVE;
use masp_proofs::prover::LocalTxProver;
use namada::ledger::governance::storage as gov_storage;
use namada::ledger::masp::{ShieldedContext, ShieldedUtils};

use namada::ledger::rpc::{TxBroadcastData, TxResponse};
use namada::ledger::signing::TxSigningKey;
use namada::ledger::wallet::{Wallet, WalletUtils};
Expand Down Expand Up @@ -92,7 +92,7 @@ pub async fn submit_init_validator<
max_commission_rate_change,
validator_vp_code_path,
unsafe_dont_encrypt,
tx_code_path,
tx_code_path: _,
}: args::TxInitValidator,
) {
let tx_args = args::Tx {
Expand Down
4 changes: 2 additions & 2 deletions apps/src/lib/wallet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ impl WalletUtils for CliWalletUtils {
}

fn show_overwrite_confirmation(
alias: &Alias,
alias_for: &str,
_alias: &Alias,
_alias_for: &str,
) -> ConfirmationResponse {
ConfirmationResponse::Replace
}
Expand Down
6 changes: 3 additions & 3 deletions apps/src/lib/wallet/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ use std::fs;
use std::io::prelude::*;
use std::io::Write;
use std::path::{Path, PathBuf};
use std::str::FromStr;


use ark_std::rand::prelude::*;
use ark_std::rand::SeedableRng;
use file_lock::{FileLock, FileOptions};
use namada::ledger::wallet::store::AddressVpType;

#[cfg(feature = "dev")]
use namada::ledger::wallet::StoredKeypair;
use namada::ledger::wallet::{gen_sk, Store, ValidatorKeys};
use namada::types::address::Address;

use namada::types::key::*;
use namada::types::transaction::EllipticCurve;
use thiserror::Error;
Expand Down

0 comments on commit 37a56a5

Please sign in to comment.