chore: regenerate umbrella crate, fix feature propagation

This commit is contained in:
2025-12-16 11:28:32 +03:00
parent dd6d48f528
commit 620b0e3aa0
1358 changed files with 9464 additions and 7656 deletions
@@ -198,10 +198,11 @@ impl<T: Config> ListScenario<T> {
)?;
// Find a destination weight that will trigger the worst case scenario
let dest_weight_as_vote = <T as pezpallet_staking::Config>::VoterList::score_update_worst_case(
&pool_origin1,
is_increase,
);
let dest_weight_as_vote =
<T as pezpallet_staking::Config>::VoterList::score_update_worst_case(
&pool_origin1,
is_increase,
);
let dest_weight: BalanceOf<T> =
dest_weight_as_vote.try_into().map_err(|_| "could not convert u64 to Balance")?;
@@ -992,8 +993,8 @@ mod benchmarks {
Some(deposit_amount),
);
// ugly type conversion between balances of pezpallet staking and pools (which really are same
// type). Maybe there is a better way?
// ugly type conversion between balances of pezpallet staking and pools (which really are
// same type). Maybe there is a better way?
let slash_amount: u128 = deposit_amount.into() / 2;
// slash pool by half
@@ -18,9 +18,8 @@
use crate::VoterBagsListInstance;
use pezframe_election_provider_support::VoteWeight;
use pezframe_support::{
derive_impl,
derive_impl, parameter_types,
pezpallet_prelude::*,
parameter_types,
traits::{ConstU64, Nothing, VariantCountOf},
PalletId,
};
@@ -23,11 +23,11 @@
//! Once a panic is found, it can be debugged with
//! `cargo hfuzz run-debug per_thing_rational hfuzz_workspace/call/*.fuzz`.
use honggfuzz::fuzz;
use pezframe_support::{
assert_ok,
traits::{Currency, GetCallName, UnfilteredDispatchable},
};
use honggfuzz::fuzz;
use pezpallet_nomination_pools::{
log,
mock::*,
@@ -36,8 +36,8 @@ use pezpallet_nomination_pools::{
BondExtra, BondedPool, GlobalMaxCommission, LastPoolId, MaxPoolMembers, MaxPoolMembersPerPool,
MaxPools, MinCreateBond, MinJoinBond, PoolId,
};
use rand::{seq::SliceRandom, Rng};
use pezsp_runtime::{assert_eq_error_rate, Perbill, Perquintill};
use rand::{seq::SliceRandom, Rng};
const ERA: BlockNumber = 1000;
const MAX_ED_MULTIPLE: Balance = 10_000;
+15 -14
View File
@@ -17,8 +17,8 @@
//! # Nomination Pools for Staking Delegation
//!
//! A pezpallet that allows members to delegate their stake to nominating pools. A nomination pool acts
//! as nominator and nominates validators on the members' behalf.
//! A pezpallet that allows members to delegate their stake to nominating pools. A nomination pool
//! acts as nominator and nominates validators on the members' behalf.
//!
//! # Index
//!
@@ -81,8 +81,8 @@
//!
//! > A member can have up to [`Config::MaxUnbonding`] distinct active unbonding requests.
//!
//! Second, once [`pezsp_staking::StakingInterface::bonding_duration`] eras have passed, the member can
//! call [`Call::withdraw_unbonded`] to withdraw any funds that are free.
//! Second, once [`pezsp_staking::StakingInterface::bonding_duration`] eras have passed, the member
//! can call [`Call::withdraw_unbonded`] to withdraw any funds that are free.
//!
//! For design docs see the [bonded pool](#bonded-pool) and [unbonding sub
//! pools](#unbonding-sub-pools) sections.
@@ -214,8 +214,8 @@
//! ## Design
//!
//! _Notes_: this section uses pseudo code to explain general design and does not necessarily
//! reflect the exact implementation. Additionally, a working knowledge of `pezpallet-staking`'s api is
//! assumed.
//! reflect the exact implementation. Additionally, a working knowledge of `pezpallet-staking`'s api
//! is assumed.
//!
//! ### Goals
//!
@@ -368,7 +368,6 @@ use pezframe_support::{
},
DefaultNoBound, PalletError,
};
use scale_info::TypeInfo;
use pezsp_core::U256;
use pezsp_runtime::{
traits::{
@@ -378,6 +377,7 @@ use pezsp_runtime::{
FixedPointNumber, Perbill,
};
use pezsp_staking::{EraIndex, StakingInterface};
use scale_info::TypeInfo;
#[cfg(any(feature = "try-runtime", feature = "fuzzing", test, debug_assertions))]
use pezsp_runtime::TryRuntimeError;
@@ -1672,7 +1672,8 @@ pub mod pezpallet {
pub trait Config: pezframe_system::Config {
/// The 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>;
/// Weight information for extrinsics in this pezpallet.
type WeightInfo: weights::WeightInfo;
@@ -1693,9 +1694,9 @@ pub mod pezpallet {
/// a PITA to do).
///
/// See the inline code docs of `Member::pending_rewards` and `RewardPool::update_recorded`
/// for example analysis. A [`pezsp_runtime::FixedU128`] should be fine for chains with balance
/// types similar to that of Pezkuwi and Kusama, in the absence of severe slashing (or
/// prevented via a reasonable `MaxPointsToBalance`), for many many years to come.
/// for example analysis. A [`pezsp_runtime::FixedU128`] should be fine for chains with
/// balance types similar to that of Pezkuwi and Kusama, in the absence of severe slashing
/// (or prevented via a reasonable `MaxPointsToBalance`), for many many years to come.
type RewardCounter: FixedPointNumber + MaxEncodedLen + TypeInfo + Default + codec::FullCodec;
/// The nomination pool's pezpallet id.
@@ -2008,9 +2009,9 @@ pub mod pezpallet {
CannotWithdrawAny,
/// The amount does not meet the minimum bond to either join or create a pool.
///
/// The depositor can never unbond to a value less than `Pezpallet::depositor_min_bond`. The
/// caller does not have nominating permissions for the pool. Members can never unbond to a
/// value below `MinJoinBond`.
/// The depositor can never unbond to a value less than `Pezpallet::depositor_min_bond`.
/// The caller does not have nominating permissions for the pool. Members can never
/// unbond to a value below `MinJoinBond`.
MinimumBondNotMet,
/// The transaction could not be executed due to overflow risk for the pool.
OverflowRisk,
@@ -36,8 +36,8 @@ pub mod versioned {
<T as pezframe_system::Config>::DbWeight,
>;
/// Migration V6 to V7 wrapped in a [`pezframe_support::migrations::VersionedMigration`], ensuring
/// the migration is only performed when on-chain version is 6.
/// Migration V6 to V7 wrapped in a [`pezframe_support::migrations::VersionedMigration`],
/// ensuring the migration is only performed when on-chain version is 6.
pub type V6ToV7<T> = pezframe_support::migrations::VersionedMigration<
6,
7,
@@ -621,9 +621,7 @@ pub mod v4 {
///
/// This migration adds a `commission` field to every `BondedPoolInner`, if
/// any.
#[deprecated(
note = "To avoid mangled storage please use `MigrateV3ToV5` instead."
)]
#[deprecated(note = "To avoid mangled storage please use `MigrateV3ToV5` instead.")]
pub struct MigrateToV4<T, U>(core::marker::PhantomData<(T, U)>);
#[allow(deprecated)]
impl<T: Config, U: Get<Perbill>> OnRuntimeUpgrade for MigrateToV4<T, U> {
@@ -1155,7 +1153,9 @@ mod helpers {
pub(crate) fn calculate_tvl_by_total_stake<T: Config>() -> BalanceOf<T> {
BondedPools::<T>::iter_keys()
.map(|id| {
T::StakeAdapter::total_stake(Pool::from(Pezpallet::<T>::generate_bonded_account(id)))
T::StakeAdapter::total_stake(Pool::from(Pezpallet::<T>::generate_bonded_account(
id,
)))
})
.reduce(|acc, total_balance| acc + total_balance)
.unwrap_or_default()
@@ -32,8 +32,8 @@ pub type BlockNumber = u64;
pub type AccountId = u128;
pub type Balance = u128;
pub type RewardCounter = FixedU128;
// This sneaky little hack allows us to write code exactly as we would do in the pezpallet in the tests
// as well, e.g. `StorageItem::<T>::get()`.
// This sneaky little hack allows us to write code exactly as we would do in the pezpallet in the
// tests as well, e.g. `StorageItem::<T>::get()`.
pub type T = Runtime;
pub type Currency = <T as Config>::Currency;
@@ -4614,7 +4614,9 @@ mod withdraw_unbonded {
// pool is destroyed.
assert!(!Metadata::<T>::contains_key(1));
// ensure the pool account is reaped.
assert!(!pezframe_system::Account::<T>::contains_key(&Pools::generate_bonded_account(1)));
assert!(!pezframe_system::Account::<T>::contains_key(&Pools::generate_bonded_account(
1
)));
})
}
@@ -21,6 +21,7 @@
#[allow(unexpected_cfgs)]
mod mock;
use mock::*;
use pezframe_support::{
assert_noop, assert_ok, hypothetically,
traits::{
@@ -28,7 +29,6 @@ use pezframe_support::{
Currency,
},
};
use mock::*;
use pezpallet_nomination_pools::{
BondExtra, BondedPools, CommissionChangeRate, ConfigOp, Error as PoolsError,
Event as PoolsEvent, LastPoolId, PoolMember, PoolMembers, PoolState,
@@ -20,9 +20,8 @@
use pezframe_election_provider_support::VoteWeight;
use pezframe_support::{
assert_ok, derive_impl,
assert_ok, derive_impl, parameter_types,
pezpallet_prelude::*,
parameter_types,
traits::{ConstU64, ConstU8, Nothing, VariantCountOf},
PalletId,
};