Skip to content

Commit

Permalink
fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
tzemanovic committed Jul 16, 2024
1 parent f72e915 commit 5966395
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 33 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ clippy-wasm = $(cargo) +$(nightly) clippy --manifest-path $(wasm)/Cargo.toml --a

# Need a separate command for benchmarks to prevent the "testing" feature flag from being activated
clippy:
$(cargo) +$(nightly) clippy $(jobs) --all-targets --workspace --exclude namada_benchmarks -- -D warnings && \
$(cargo) +$(nightly) clippy $(jobs) --all-targets --package namada_benchmarks -- -D warnings && \
$(cargo) +$(nightly) clippy $(jobs) --all-targets --workspace --exclude namada_benchmarks -- -D warnings --check-cfg 'cfg(fuzzing)' && \
$(cargo) +$(nightly) clippy $(jobs) --all-targets --package namada_benchmarks -- -D warnings --check-cfg 'cfg(fuzzing)' && \
make -C $(wasms) clippy && \
make -C $(wasms_for_tests) clippy

Expand Down
20 changes: 9 additions & 11 deletions crates/node/src/shell/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1491,12 +1491,12 @@ pub mod test_utils {

/// Generate a random public/private keypair
#[inline]
pub(super) fn gen_keypair() -> common::SecretKey {
pub fn gen_keypair() -> common::SecretKey {
gen_ed25519_keypair()
}

/// Generate a random ed25519 public/private keypair
pub(super) fn gen_ed25519_keypair() -> common::SecretKey {
pub fn gen_ed25519_keypair() -> common::SecretKey {
use rand::prelude::ThreadRng;
use rand::thread_rng;

Expand All @@ -1505,7 +1505,7 @@ pub mod test_utils {
}

/// Generate a random secp256k1 public/private keypair
pub(super) fn gen_secp256k1_keypair() -> common::SecretKey {
pub fn gen_secp256k1_keypair() -> common::SecretKey {
use rand::prelude::ThreadRng;
use rand::thread_rng;

Expand All @@ -1516,9 +1516,7 @@ pub mod test_utils {
}

/// Invalidate a valid signature `sig`.
pub(super) fn invalidate_signature(
sig: common::Signature,
) -> common::Signature {
pub fn invalidate_signature(sig: common::Signature) -> common::Signature {
match sig {
common::Signature::Ed25519(ed25519::Signature(ref sig)) => {
let mut sig_bytes = sig.to_bytes();
Expand Down Expand Up @@ -1804,7 +1802,7 @@ pub mod test_utils {
/// Start a new test shell and initialize it. Returns the shell paired with
/// a broadcast receiver, which will receives any protocol txs sent by the
/// shell.
pub(super) fn setup_with_cfg<H: Into<BlockHeight>>(
pub fn setup_with_cfg<H: Into<BlockHeight>>(
SetupCfg {
last_height,
num_validators,
Expand Down Expand Up @@ -1865,7 +1863,7 @@ pub mod test_utils {
/// Same as [`setup_at_height`], but returns a shell at the given block
/// height, with a single validator.
#[inline]
pub(super) fn setup_at_height<H: Into<BlockHeight>>(
pub fn setup_at_height<H: Into<BlockHeight>>(
last_height: H,
) -> (
TestShell,
Expand Down Expand Up @@ -1919,7 +1917,7 @@ pub mod test_utils {
}

/// Set the Ethereum bridge to be inactive
pub(super) fn deactivate_bridge(shell: &mut TestShell) {
pub fn deactivate_bridge(shell: &mut TestShell) {
use namada::eth_bridge::storage::active_key;
use namada::eth_bridge::storage::eth_bridge_queries::EthBridgeStatus;
shell
Expand All @@ -1928,7 +1926,7 @@ pub mod test_utils {
.expect("Test failed");
}

pub(super) fn get_pkh_from_address<S>(
pub fn get_pkh_from_address<S>(
storage: &S,
params: &PosParams,
address: Address,
Expand All @@ -1946,7 +1944,7 @@ pub mod test_utils {
TryFrom::try_from(decoded).unwrap()
}

pub(super) fn next_block_for_inflation(
pub fn next_block_for_inflation(
shell: &mut TestShell,
proposer_address: Vec<u8>,
votes: Vec<VoteInfo>,
Expand Down
43 changes: 33 additions & 10 deletions wasm/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 33 additions & 10 deletions wasm_for_tests/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5966395

Please sign in to comment.