Skip to content

Commit db20d10

Browse files
committed
Address PR review: DispatchClass::Normal and clippy fix
1 parent 92b39a0 commit db20d10

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
@@ -2620,7 +2620,7 @@ mod dispatches {
26202620
Weight::from_parts(10_000, 0)
26212621
.saturating_add(T::DbWeight::get().reads(2))
26222622
.saturating_add(T::DbWeight::get().writes(1)),
2623-
DispatchClass::Operational,
2623+
DispatchClass::Normal,
26242624
Pays::Yes
26252625
))]
26262626
pub fn set_liquid_alpha_consensus_mode(

0 commit comments

Comments
 (0)