Skip to content

Commit 5701e8c

Browse files
konrad0960ppolewicz
authored andcommitted
Address PR review: DispatchClass::Normal and clippy fix
1 parent abda84a commit 5701e8c

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

pallets/subtensor/src/epoch/run_epoch.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1382,9 +1382,11 @@ impl<T: Config> Pallet<T> {
13821382
ConsensusMode::Auto => {
13831383
// Auto mode: Previous if bond_penalty == 1, otherwise Current
13841384
let bonds_penalty = Self::get_float_bonds_penalty(netuid);
1385-
(bonds_penalty == I32F32::from_num(1))
1386-
.then(|| Self::get_previous_consensus_as_i32f32(netuid))
1387-
.unwrap_or_else(|| current_consensus.to_vec())
1385+
if bonds_penalty == I32F32::from_num(1) {
1386+
Self::get_previous_consensus_as_i32f32(netuid)
1387+
} else {
1388+
current_consensus.to_vec()
1389+
}
13881390
}
13891391
}
13901392
}

pallets/subtensor/src/macros/dispatches.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2647,7 +2647,7 @@ mod dispatches {
26472647
Weight::from_parts(10_000, 0)
26482648
.saturating_add(T::DbWeight::get().reads(2))
26492649
.saturating_add(T::DbWeight::get().writes(1)),
2650-
DispatchClass::Operational,
2650+
DispatchClass::Normal,
26512651
Pays::Yes
26522652
))]
26532653
pub fn set_liquid_alpha_consensus_mode(

0 commit comments

Comments
 (0)