chore: regenerate umbrella crate, fix feature propagation
This commit is contained in:
@@ -166,7 +166,10 @@ mod benchmarks {
|
||||
// ... and register them.
|
||||
for (who, _) in candidates.iter() {
|
||||
let deposit = CandidacyBond::<T>::get();
|
||||
<T as pezpallet::Config>::Currency::make_free_balance_be(who, deposit * 1000_u32.into());
|
||||
<T as pezpallet::Config>::Currency::make_free_balance_be(
|
||||
who,
|
||||
deposit * 1000_u32.into(),
|
||||
);
|
||||
CandidateList::<T>::try_mutate(|list| {
|
||||
list.try_push(CandidateInfo { who: who.clone(), deposit }).unwrap();
|
||||
Ok::<(), BenchmarkError>(())
|
||||
@@ -242,7 +245,8 @@ mod benchmarks {
|
||||
let bond_amount = if k > 0 {
|
||||
CandidateList::<T>::mutate(|candidates| {
|
||||
for info in candidates.iter_mut().skip(kicked as usize) {
|
||||
info.deposit = <T as pezpallet::Config>::Currency::minimum_balance() * 3u32.into();
|
||||
info.deposit =
|
||||
<T as pezpallet::Config>::Currency::minimum_balance() * 3u32.into();
|
||||
}
|
||||
});
|
||||
<T as pezpallet::Config>::Currency::minimum_balance() * 3u32.into()
|
||||
@@ -297,7 +301,8 @@ mod benchmarks {
|
||||
register_candidates::<T>(c);
|
||||
|
||||
let caller: T::AccountId = whitelisted_caller();
|
||||
let bond: BalanceOf<T> = <T as pezpallet::Config>::Currency::minimum_balance() * 2u32.into();
|
||||
let bond: BalanceOf<T> =
|
||||
<T as pezpallet::Config>::Currency::minimum_balance() * 2u32.into();
|
||||
<T as pezpallet::Config>::Currency::make_free_balance_be(&caller, bond);
|
||||
|
||||
<session::Pezpallet<T>>::ensure_can_pay_key_deposit(&caller).unwrap();
|
||||
@@ -325,7 +330,8 @@ mod benchmarks {
|
||||
register_candidates::<T>(c);
|
||||
|
||||
let caller: T::AccountId = whitelisted_caller();
|
||||
let bond: BalanceOf<T> = <T as pezpallet::Config>::Currency::minimum_balance() * 10u32.into();
|
||||
let bond: BalanceOf<T> =
|
||||
<T as pezpallet::Config>::Currency::minimum_balance() * 10u32.into();
|
||||
<T as pezpallet::Config>::Currency::make_free_balance_be(&caller, bond);
|
||||
|
||||
<session::Pezpallet<T>>::ensure_can_pay_key_deposit(&caller).unwrap();
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
//! ## Overview
|
||||
//!
|
||||
//! The Collator Selection pezpallet manages the collators of a teyrchain. **Collation is _not_ a
|
||||
//! secure activity** and this pezpallet does not implement any game-theoretic mechanisms to meet BFT
|
||||
//! safety assumptions of the chosen set.
|
||||
//! secure activity** and this pezpallet does not implement any game-theoretic mechanisms to meet
|
||||
//! BFT safety assumptions of the chosen set.
|
||||
//!
|
||||
//! ## Terminology
|
||||
//!
|
||||
@@ -142,7 +142,8 @@ pub mod pezpallet {
|
||||
pub trait Config: pezframe_system::Config {
|
||||
/// Overarching event type.
|
||||
#[allow(deprecated)]
|
||||
type RuntimeEvent: From<Event<Self>> + IsType<<Self as pezframe_system::Config>::RuntimeEvent>;
|
||||
type RuntimeEvent: From<Event<Self>>
|
||||
+ IsType<<Self as pezframe_system::Config>::RuntimeEvent>;
|
||||
|
||||
/// The currency mechanism.
|
||||
type Currency: ReservableCurrency<Self::AccountId>;
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
use super::*;
|
||||
#[cfg(feature = "try-runtime")]
|
||||
use alloc::vec::Vec;
|
||||
use pezframe_support::traits::{OnRuntimeUpgrade, UncheckedOnRuntimeUpgrade};
|
||||
use log;
|
||||
use pezframe_support::traits::{OnRuntimeUpgrade, UncheckedOnRuntimeUpgrade};
|
||||
|
||||
/// Migrate to v2. Should have been part of <https://github.com/pezkuwichain/kurdistan-sdk/issues/104>.
|
||||
pub mod v2 {
|
||||
@@ -44,15 +44,26 @@ pub mod v2 {
|
||||
>;
|
||||
|
||||
#[storage_alias]
|
||||
pub type Candidates<T: Config> = StorageValue<
|
||||
Pezpallet<T>,
|
||||
BoundedVec<CandidateInfo<<T as pezframe_system::Config>::AccountId, <<T as Config>::Currency as Currency<<T as pezframe_system::Config>::AccountId>>::Balance>, <T as Config>::MaxCandidates>,
|
||||
ValueQuery,
|
||||
>;
|
||||
pub type Candidates<T: Config> =
|
||||
StorageValue<
|
||||
Pezpallet<T>,
|
||||
BoundedVec<
|
||||
CandidateInfo<
|
||||
<T as pezframe_system::Config>::AccountId,
|
||||
<<T as Config>::Currency as Currency<
|
||||
<T as pezframe_system::Config>::AccountId,
|
||||
>>::Balance,
|
||||
>,
|
||||
<T as Config>::MaxCandidates,
|
||||
>,
|
||||
ValueQuery,
|
||||
>;
|
||||
|
||||
/// Migrate to V2.
|
||||
pub struct UncheckedMigrationToV2<T>(PhantomData<T>);
|
||||
impl<T: Config + pezpallet_balances::Config> UncheckedOnRuntimeUpgrade for UncheckedMigrationToV2<T> {
|
||||
impl<T: Config + pezpallet_balances::Config> UncheckedOnRuntimeUpgrade
|
||||
for UncheckedMigrationToV2<T>
|
||||
{
|
||||
fn on_runtime_upgrade() -> Weight {
|
||||
let mut weight = Weight::zero();
|
||||
let mut count: u64 = 0;
|
||||
@@ -107,7 +118,9 @@ pub mod v2 {
|
||||
}
|
||||
|
||||
#[cfg(feature = "try-runtime")]
|
||||
fn post_upgrade(_number_of_candidates: Vec<u8>) -> Result<(), pezsp_runtime::DispatchError> {
|
||||
fn post_upgrade(
|
||||
_number_of_candidates: Vec<u8>,
|
||||
) -> Result<(), pezsp_runtime::DispatchError> {
|
||||
let new_number_of_candidates = Candidates::<T>::get().to_vec().len();
|
||||
assert_eq!(
|
||||
new_number_of_candidates, 0 as usize,
|
||||
@@ -160,7 +173,9 @@ pub mod v1 {
|
||||
}
|
||||
|
||||
#[cfg(feature = "try-runtime")]
|
||||
fn post_upgrade(number_of_invulnerables: Vec<u8>) -> Result<(), pezsp_runtime::DispatchError> {
|
||||
fn post_upgrade(
|
||||
number_of_invulnerables: Vec<u8>,
|
||||
) -> Result<(), pezsp_runtime::DispatchError> {
|
||||
let stored_invulnerables = Invulnerables::<T>::get().to_vec();
|
||||
let mut sorted_invulnerables = stored_invulnerables.clone();
|
||||
sorted_invulnerables.sort();
|
||||
|
||||
Reference in New Issue
Block a user