Skip to content

Commit 593ad2e

Browse files
committed
Fix clippy and tests for all featrues
1 parent d511dad commit 593ad2e

File tree

8 files changed

+20
-6
lines changed

8 files changed

+20
-6
lines changed

node/src/benchmarking.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ impl frame_benchmarking_cli::ExtrinsicBuilder for TransferKeepAliveBuilder {
105105
// Create a transaction using the given `call`.
106106
//
107107
// Note: Should only be used for benchmarking.
108+
#[allow(clippy::expect_used)]
108109
pub fn create_benchmark_extrinsic(
109110
client: &FullClient,
110111
sender: sp_core::sr25519::Pair,

pallets/collective/src/benchmarking.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@
1616
// limitations under the License.
1717

1818
//! Staking pallet benchmarking.
19-
#![allow(clippy::arithmetic_side_effects, clippy::indexing_slicing)]
19+
#![allow(
20+
clippy::arithmetic_side_effects,
21+
clippy::expect_used,
22+
clippy::indexing_slicing
23+
)]
2024

2125
use super::*;
2226
use crate::Pallet as Collective;

pallets/collective/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,6 +1131,7 @@ impl<
11311131
}
11321132

11331133
#[cfg(feature = "runtime-benchmarks")]
1134+
#[allow(clippy::expect_used)]
11341135
fn try_successful_origin() -> Result<O, ()> {
11351136
let zero_account_id =
11361137
AccountId::decode(&mut sp_runtime::traits::TrailingZeroInput::zeroes())

pallets/commitments/src/benchmarking.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Benchmarking setup
22
#![cfg(feature = "runtime-benchmarks")]
3-
#![allow(clippy::arithmetic_side_effects)]
3+
#![allow(clippy::arithmetic_side_effects, clippy::expect_used)]
44
use super::*;
55

66
#[allow(unused)]

pallets/proxy/src/benchmarking.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
// Benchmarks for Proxy Pallet
1919

2020
#![cfg(feature = "runtime-benchmarks")]
21-
#![allow(clippy::arithmetic_side_effects)]
21+
#![allow(clippy::arithmetic_side_effects, clippy::unwrap_used)]
2222

2323
use super::*;
2424
use crate::Pallet as Proxy;
@@ -321,7 +321,8 @@ mod benchmarks {
321321
0,
322322
);
323323

324-
let pure_account = Pallet::<T>::pure_account(&caller, &T::ProxyType::default(), 0, None);
324+
let pure_account =
325+
Pallet::<T>::pure_account(&caller, &T::ProxyType::default(), 0, None).unwrap();
325326
assert_last_event::<T>(
326327
Event::PureCreated {
327328
pure: pure_account,
@@ -348,7 +349,8 @@ mod benchmarks {
348349
)?;
349350
let height = T::BlockNumberProvider::current_block_number();
350351
let ext_index = frame_system::Pallet::<T>::extrinsic_index().unwrap_or(0);
351-
let pure_account = Pallet::<T>::pure_account(&caller, &T::ProxyType::default(), 0, None);
352+
let pure_account =
353+
Pallet::<T>::pure_account(&caller, &T::ProxyType::default(), 0, None).unwrap();
352354

353355
add_proxies::<T>(p, Some(pure_account.clone()))?;
354356
ensure!(

pallets/registry/src/benchmarking.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
//! Benchmarking setup
22
#![cfg(feature = "runtime-benchmarks")]
3-
#![allow(clippy::arithmetic_side_effects, clippy::unwrap_used)]
3+
#![allow(
4+
clippy::arithmetic_side_effects,
5+
clippy::expect_used,
6+
clippy::unwrap_used
7+
)]
48
use super::*;
59

610
#[allow(unused)]

pallets/subtensor/src/utils/try_state.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use super::*;
55
impl<T: Config> Pallet<T> {
66
/// Checks [`TotalIssuance`] equals the sum of currency issuance, total stake, and total subnet
77
/// locked.
8+
#[allow(clippy::expect_used)]
89
pub(crate) fn check_total_issuance() -> Result<(), sp_runtime::TryRuntimeError> {
910
// Get the total currency issuance
1011
let currency_issuance = <T as Config>::Currency::total_issuance();

runtime/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2293,6 +2293,7 @@ impl_runtime_apis! {
22932293
(weight, BlockWeights::get().max_block)
22942294
}
22952295

2296+
#[allow(clippy::expect_used)]
22962297
fn execute_block(
22972298
block: Block,
22982299
state_root_check: bool,

0 commit comments

Comments
 (0)