mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 05:51:02 +00:00
Split SolutionImprovementThresholds into two types (#11221)
* Splitting `SolutionImprovementThreshold` in 2 One for Signed phase and one for Unsigned phase. * Adding some tests * Fixes after code review. - Removing `GetDefault`. - Shorter naming. - More explicit test.
This commit is contained in:
@@ -624,7 +624,7 @@ impl<T: Config> Pallet<T> {
|
||||
ensure!(
|
||||
Self::queued_solution().map_or(true, |q: ReadySolution<_>| raw_solution
|
||||
.score
|
||||
.strict_threshold_better(q.score, T::SolutionImprovementThreshold::get())),
|
||||
.strict_threshold_better(q.score, T::BetterUnsignedThreshold::get())),
|
||||
Error::<T>::PreDispatchWeakSubmission,
|
||||
);
|
||||
|
||||
@@ -1066,7 +1066,7 @@ mod tests {
|
||||
.desired_targets(1)
|
||||
.add_voter(7, 2, bounded_vec![10])
|
||||
.add_voter(8, 5, bounded_vec![10])
|
||||
.solution_improvement_threshold(Perbill::from_percent(50))
|
||||
.better_unsigned_threshold(Perbill::from_percent(50))
|
||||
.build_and_execute(|| {
|
||||
roll_to(25);
|
||||
assert!(MultiPhase::current_phase().is_unsigned());
|
||||
|
||||
Reference in New Issue
Block a user