fix: Complete snowbridge pezpallet rebrand and critical bug fixes
- snowbridge-pezpallet-* → pezsnowbridge-pezpallet-* (201 refs) - pallet/ directories → pezpallet/ (4 locations) - Fixed pezpallet.rs self-include recursion bug - Fixed sc-chain-spec hardcoded crate name in derive macro - Reverted .pezpallet_by_name() to .pallet_by_name() (subxt API) - Added BizinikiwiConfig type alias for zombienet tests - Deleted obsolete session state files Verified: pezsnowbridge-pezpallet-*, pezpallet-staking, pezpallet-staking-async, pezframe-benchmarking-cli all pass cargo check
This commit is contained in:
@@ -4,7 +4,7 @@ All notable changes and migrations to pezpallet-staking will be documented in th
|
||||
|
||||
The format is loosely based
|
||||
on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). We maintain a
|
||||
single integer version number for staking pallet to keep track of all storage
|
||||
single integer version number for staking pezpallet to keep track of all storage
|
||||
migrations.
|
||||
|
||||
## [v16]
|
||||
|
||||
@@ -6,7 +6,7 @@ edition.workspace = true
|
||||
license = "Apache-2.0"
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
description = "FRAME pallet staking"
|
||||
description = "FRAME pezpallet staking"
|
||||
readme = "README.md"
|
||||
documentation = "https://docs.rs/pezpallet-staking"
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ The staking system in Bizinikiwi NPoS is designed to make the following possible
|
||||
|
||||
Almost any interaction with the Staking module requires a process of _**bonding**_ (also known as becoming a _staker_). To
|
||||
become *bonded*, a fund-holding account known as the _stash account_ (which holds some or all of the funds that become
|
||||
frozen in place as part of the staking process) gets assigned by the pallet to a _controller account_. The controller account
|
||||
frozen in place as part of the staking process) gets assigned by the pezpallet to a _controller account_. The controller account
|
||||
then issues instructions on how funds shall be used.
|
||||
|
||||
An account can become a bonded stash account using the
|
||||
@@ -141,25 +141,25 @@ The Staking module contains many public storage items and (im)mutable functions.
|
||||
```rust
|
||||
use pallet_staking::{self as staking};
|
||||
|
||||
#[frame_support::pallet]
|
||||
pub mod pallet {
|
||||
#[frame_support::pezpallet]
|
||||
pub mod pezpallet {
|
||||
use super::*;
|
||||
use frame_support::pallet_prelude::*;
|
||||
use frame_system::pallet_prelude::*;
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(_);
|
||||
#[pezpallet::pezpallet]
|
||||
pub struct Pezpallet<T>(_);
|
||||
|
||||
#[pallet::config]
|
||||
#[pezpallet::config]
|
||||
pub trait Config: frame_system::Config + staking::Config {}
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pezpallet::call]
|
||||
impl<T: Config> Pezpallet<T> {
|
||||
/// Reward a validator.
|
||||
#[pallet::weight(0)]
|
||||
#[pezpallet::weight(0)]
|
||||
pub fn reward_myself(origin: OriginFor<T>) -> DispatchResult {
|
||||
let reported = ensure_signed(origin)?;
|
||||
<staking::Pallet<T>>::reward_by_ids(vec![(reported, 10)]);
|
||||
<staking::Pezpallet<T>>::reward_by_ids(vec![(reported, 10)]);
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ edition.workspace = true
|
||||
license = "Apache-2.0"
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
description = "Reward Curve for FRAME staking pallet"
|
||||
description = "Reward Curve for FRAME staking pezpallet"
|
||||
documentation = "https://docs.rs/pezpallet-staking-reward-curve"
|
||||
|
||||
[lints]
|
||||
|
||||
@@ -6,7 +6,7 @@ edition.workspace = true
|
||||
license = "Apache-2.0"
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
description = "Reward function for FRAME staking pallet"
|
||||
description = "Reward function for FRAME staking pezpallet"
|
||||
documentation = "https://docs.rs/pezpallet-staking-reward-fn"
|
||||
|
||||
[lints]
|
||||
|
||||
@@ -6,7 +6,7 @@ edition.workspace = true
|
||||
license = "Apache-2.0"
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
description = "RPC runtime API for transaction payment FRAME pallet"
|
||||
description = "RPC runtime API for transaction payment FRAME pezpallet"
|
||||
readme = "README.md"
|
||||
documentation = "https://docs.rs/pezpallet-staking-runtime-api"
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
Runtime API definition for the staking pallet.
|
||||
Runtime API definition for the staking pezpallet.
|
||||
|
||||
License: Apache-2.0
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! Runtime API definition for the staking pallet.
|
||||
//! Runtime API definition for the staking pezpallet.
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! Staking pallet benchmarking.
|
||||
//! Staking pezpallet benchmarking.
|
||||
|
||||
use super::*;
|
||||
use crate::{asset, ConfigOp, Pallet as Staking};
|
||||
use crate::{asset, ConfigOp, Pezpallet as Staking};
|
||||
use testing_utils::*;
|
||||
|
||||
use codec::Decode;
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
//!
|
||||
//! ### Implementation Details
|
||||
//!
|
||||
//! The current implementation of the static tracker is tightly coupled with the staking pallet
|
||||
//! The current implementation of the static tracker is tightly coupled with the staking pezpallet
|
||||
//! implementation, namely the representation of a voter ([`VoterOf`]). The SCALE encoded byte size
|
||||
//! is calculated using [`Encode::size_hint`] of each type in the voter tuple. Each voter's byte
|
||||
//! size is the sum of:
|
||||
|
||||
@@ -36,7 +36,7 @@ use pezsp_runtime::DispatchResult;
|
||||
use pezsp_staking::{StakingAccount, StakingInterface};
|
||||
|
||||
use crate::{
|
||||
asset, BalanceOf, Bonded, Config, Error, Ledger, Pallet, Payee, RewardDestination,
|
||||
asset, BalanceOf, Bonded, Config, Error, Ledger, Pezpallet, Payee, RewardDestination,
|
||||
StakingLedger, VirtualStakers,
|
||||
};
|
||||
|
||||
@@ -186,7 +186,7 @@ impl<T: Config> StakingLedger<T> {
|
||||
}
|
||||
|
||||
// We skip locking virtual stakers.
|
||||
if !Pallet::<T>::is_virtual_staker(&self.stash) {
|
||||
if !Pezpallet::<T>::is_virtual_staker(&self.stash) {
|
||||
// for direct stakers, update lock on stash based on ledger.
|
||||
asset::update_stake::<T>(&self.stash, self.total)
|
||||
.map_err(|_| Error::<T>::NotEnoughFunds)?;
|
||||
|
||||
@@ -15,17 +15,17 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! # Staking Pallet
|
||||
//! # Staking Pezpallet
|
||||
//!
|
||||
//! The Staking pallet is used to manage funds at stake by network maintainers.
|
||||
//! The Staking pezpallet is used to manage funds at stake by network maintainers.
|
||||
//!
|
||||
//! - [`Config`]
|
||||
//! - [`Call`]
|
||||
//! - [`Pallet`]
|
||||
//! - [`Pezpallet`]
|
||||
//!
|
||||
//! ## Overview
|
||||
//!
|
||||
//! The Staking pallet is the means by which a set of network maintainers (known as _authorities_ in
|
||||
//! The Staking pezpallet is the means by which a set of network maintainers (known as _authorities_ in
|
||||
//! some contexts and _validators_ in others) are chosen based upon those who voluntarily place
|
||||
//! funds under deposit. Under deposit, those funds are rewarded under normal operation but are held
|
||||
//! at pain of _slash_ (expropriation) should the staked maintainer be found not to be discharging
|
||||
@@ -59,10 +59,10 @@
|
||||
//!
|
||||
//! #### Staking
|
||||
//!
|
||||
//! Almost any interaction with the Staking pallet requires a process of _**bonding**_ (also known
|
||||
//! Almost any interaction with the Staking pezpallet requires a process of _**bonding**_ (also known
|
||||
//! as being a _staker_). To become *bonded*, a fund-holding register known as the _stash account_,
|
||||
//! which holds some or all of the funds that become frozen in place as part of the staking process.
|
||||
//! The controller account, which this pallet now assigns the stash account to, issues instructions
|
||||
//! The controller account, which this pezpallet now assigns the stash account to, issues instructions
|
||||
//! on how funds shall be used.
|
||||
//!
|
||||
//! An account can become a bonded stash account using the [`bond`](Call::bond) call.
|
||||
@@ -108,7 +108,7 @@
|
||||
//!
|
||||
//! #### Rewards and Slash
|
||||
//!
|
||||
//! The **reward and slashing** procedure is the core of the Staking pallet, attempting to _embrace
|
||||
//! The **reward and slashing** procedure is the core of the Staking pezpallet, attempting to _embrace
|
||||
//! valid behavior_ while _punishing any misbehavior or lack of availability_.
|
||||
//!
|
||||
//! Rewards must be claimed for each era before it gets too old by
|
||||
@@ -124,7 +124,7 @@
|
||||
//! determined, a value is deducted from the balance of the validator and all the nominators who
|
||||
//! voted for this validator (values are deducted from the _stash_ account of the slashed entity).
|
||||
//!
|
||||
//! Slashing logic is further described in the documentation of the `slashing` pallet.
|
||||
//! Slashing logic is further described in the documentation of the `slashing` pezpallet.
|
||||
//!
|
||||
//! Similar to slashing, rewards are also shared among a validator and its associated nominators.
|
||||
//! Yet, the reward funds are not always transferred to the stash account and can be configured. See
|
||||
@@ -140,19 +140,19 @@
|
||||
//!
|
||||
//! ### Session managing
|
||||
//!
|
||||
//! The pallet implement the trait `SessionManager`. Which is the only API to query new validator
|
||||
//! The pezpallet implement the trait `SessionManager`. Which is the only API to query new validator
|
||||
//! set and allowing these validator set to be rewarded once their era is ended.
|
||||
//!
|
||||
//! ## Interface
|
||||
//!
|
||||
//! ### Dispatchable Functions
|
||||
//!
|
||||
//! The dispatchable functions of the Staking pallet enable the steps needed for entities to accept
|
||||
//! and change their role, alongside some helper functions to get/set the metadata of the pallet.
|
||||
//! The dispatchable functions of the Staking pezpallet enable the steps needed for entities to accept
|
||||
//! and change their role, alongside some helper functions to get/set the metadata of the pezpallet.
|
||||
//!
|
||||
//! ### Public Functions
|
||||
//!
|
||||
//! The Staking pallet contains many public storage items and (im)mutable functions.
|
||||
//! The Staking pezpallet contains many public storage items and (im)mutable functions.
|
||||
//!
|
||||
//! ## Usage
|
||||
//!
|
||||
@@ -162,26 +162,26 @@
|
||||
//! use pezpallet_staking::{self as staking};
|
||||
//! use pezframe_support::traits::RewardsReporter;
|
||||
//!
|
||||
//! #[pezframe_support::pallet(dev_mode)]
|
||||
//! pub mod pallet {
|
||||
//! #[pezframe_support::pezpallet(dev_mode)]
|
||||
//! pub mod pezpallet {
|
||||
//! use super::*;
|
||||
//! use pezframe_support::pezpallet_prelude::*;
|
||||
//! use pezframe_system::pezpallet_prelude::*;
|
||||
//! # use pezframe_support::traits::RewardsReporter;
|
||||
//!
|
||||
//! #[pallet::pallet]
|
||||
//! pub struct Pallet<T>(_);
|
||||
//! #[pezpallet::pezpallet]
|
||||
//! pub struct Pezpallet<T>(_);
|
||||
//!
|
||||
//! #[pallet::config]
|
||||
//! #[pezpallet::config]
|
||||
//! pub trait Config: pezframe_system::Config + staking::Config {}
|
||||
//!
|
||||
//! #[pallet::call]
|
||||
//! impl<T: Config> Pallet<T> {
|
||||
//! #[pezpallet::call]
|
||||
//! impl<T: Config> Pezpallet<T> {
|
||||
//! /// Reward a validator.
|
||||
//! #[pallet::weight(0)]
|
||||
//! #[pezpallet::weight(0)]
|
||||
//! pub fn reward_myself(origin: OriginFor<T>) -> DispatchResult {
|
||||
//! let reported = ensure_signed(origin)?;
|
||||
//! <staking::Pallet<T>>::reward_by_ids(vec![(reported, 10)]);
|
||||
//! <staking::Pezpallet<T>>::reward_by_ids(vec![(reported, 10)]);
|
||||
//! Ok(())
|
||||
//! }
|
||||
//! }
|
||||
@@ -222,9 +222,9 @@
|
||||
//!
|
||||
//! Total reward is split among validators and their nominators depending on the number of points
|
||||
//! they received during the era. Points are added to a validator using the method
|
||||
//! [`pezframe_support::traits::RewardsReporter::reward_by_ids`] implemented by the [`Pallet`].
|
||||
//! [`pezframe_support::traits::RewardsReporter::reward_by_ids`] implemented by the [`Pezpallet`].
|
||||
//!
|
||||
//! [`Pallet`] implements [`pezpallet_authorship::EventHandler`] to add reward points to block producer
|
||||
//! [`Pezpallet`] implements [`pezpallet_authorship::EventHandler`] to add reward points to block producer
|
||||
//! and block producer of referenced uncles.
|
||||
//!
|
||||
//! The validator and its nominator split their reward as following:
|
||||
@@ -275,14 +275,14 @@
|
||||
//!
|
||||
//! ## GenesisConfig
|
||||
//!
|
||||
//! The Staking pallet depends on the [`GenesisConfig`]. The `GenesisConfig` is optional and allow
|
||||
//! The Staking pezpallet depends on the [`GenesisConfig`]. The `GenesisConfig` is optional and allow
|
||||
//! to set some initial stakers.
|
||||
//!
|
||||
//! ## Related Modules
|
||||
//!
|
||||
//! - [Balances](../pezpallet_balances/index.html): Used to manage values at stake.
|
||||
//! - [Session](../pezpallet_session/index.html): Used to manage sessions. Also, a list of new
|
||||
//! validators is stored in the Session pallet's `Validators` at the end of each era.
|
||||
//! validators is stored in the Session pezpallet's `Validators` at the end of each era.
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
#![recursion_limit = "256"]
|
||||
@@ -305,7 +305,7 @@ pub mod migrations;
|
||||
pub mod slashing;
|
||||
pub mod weights;
|
||||
|
||||
mod pallet;
|
||||
mod pezpallet;
|
||||
|
||||
extern crate alloc;
|
||||
|
||||
@@ -334,7 +334,7 @@ use pezsp_staking::{
|
||||
pub use pezsp_staking::{Exposure, IndividualExposure, StakerStatus};
|
||||
pub use weights::WeightInfo;
|
||||
|
||||
pub use pallet::{pallet::*, UseNominatorsAndValidatorsMap, UseValidatorsMap};
|
||||
pub use pezpallet::{pezpallet::*, UseNominatorsAndValidatorsMap, UseValidatorsMap};
|
||||
|
||||
pub(crate) const STAKING_ID: LockIdentifier = *b"staking ";
|
||||
pub(crate) const LOG_TARGET: &str = "runtime::staking";
|
||||
@@ -345,12 +345,12 @@ macro_rules! log {
|
||||
($level:tt, $patter:expr $(, $values:expr)* $(,)?) => {
|
||||
log::$level!(
|
||||
target: crate::LOG_TARGET,
|
||||
concat!("[{:?}] 💸 ", $patter), <pezframe_system::Pallet<T>>::block_number() $(, $values)*
|
||||
concat!("[{:?}] 💸 ", $patter), <pezframe_system::Pezpallet<T>>::block_number() $(, $values)*
|
||||
)
|
||||
};
|
||||
}
|
||||
|
||||
/// Alias for the maximum number of winners (aka. active validators), as defined in by this pallet's
|
||||
/// Alias for the maximum number of winners (aka. active validators), as defined in by this pezpallet's
|
||||
/// config.
|
||||
pub type MaxWinnersOf<T> = <T as Config>::MaxValidatorSet;
|
||||
|
||||
@@ -364,7 +364,7 @@ pub type MaxNominationsOf<T> =
|
||||
/// Counter for the number of "reward" points earned by a given validator.
|
||||
pub type RewardPoint = u32;
|
||||
|
||||
/// The balance type of this pallet.
|
||||
/// The balance type of this pezpallet.
|
||||
pub type BalanceOf<T> = <T as Config>::CurrencyBalance;
|
||||
|
||||
type PositiveImbalanceOf<T> = Debt<<T as pezframe_system::Config>::AccountId, <T as Config>::Currency>;
|
||||
@@ -969,15 +969,15 @@ where
|
||||
validator: <T as pezframe_system::Config>::AccountId,
|
||||
severity: OffenceSeverity,
|
||||
) {
|
||||
<pezpallet_session::Pallet<T>>::report_offence(validator, severity)
|
||||
<pezpallet_session::Pezpallet<T>>::report_offence(validator, severity)
|
||||
}
|
||||
|
||||
fn validators() -> Vec<<T as pezframe_system::Config>::AccountId> {
|
||||
<pezpallet_session::Pallet<T>>::validators()
|
||||
<pezpallet_session::Pezpallet<T>>::validators()
|
||||
}
|
||||
|
||||
fn prune_historical_up_to(up_to: SessionIndex) {
|
||||
<pezpallet_session::historical::Pallet<T>>::prune_up_to(up_to);
|
||||
<pezpallet_session::historical::Pezpallet<T>>::prune_up_to(up_to);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1089,7 +1089,7 @@ impl<T: Config> Convert<T::AccountId, Option<Exposure<T::AccountId, BalanceOf<T>
|
||||
{
|
||||
fn convert(validator: T::AccountId) -> Option<Exposure<T::AccountId, BalanceOf<T>>> {
|
||||
ActiveEra::<T>::get()
|
||||
.map(|active_era| <Pallet<T>>::eras_stakers(active_era.index, &validator))
|
||||
.map(|active_era| <Pezpallet<T>>::eras_stakers(active_era.index, &validator))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1104,7 +1104,7 @@ impl<T: Config> Convert<T::AccountId, Option<Exposure<T::AccountId, BalanceOf<T>
|
||||
/// In the new model, we don't need to identify a validator with their full exposure anymore, and
|
||||
/// therefore [`UnitIdentificationOf`] is perfectly fine. Yet, for runtimes that used to work with
|
||||
/// [`ExposureOf`], we need to be able to decode old identification data, possibly stored in the
|
||||
/// historical session pallet in older blocks. Therefore, this type is a good compromise, allowing
|
||||
/// historical session pezpallet in older blocks. Therefore, this type is a good compromise, allowing
|
||||
/// old exposure identifications to be decoded, and returning a few zero bytes
|
||||
/// (`Exposure::default`) for any new identification request.
|
||||
///
|
||||
@@ -1150,7 +1150,7 @@ pub struct FilterHistoricalOffences<T, R> {
|
||||
}
|
||||
|
||||
impl<T, Reporter, Offender, R, O> ReportOffence<Reporter, Offender, O>
|
||||
for FilterHistoricalOffences<Pallet<T>, R>
|
||||
for FilterHistoricalOffences<Pezpallet<T>, R>
|
||||
where
|
||||
T: Config,
|
||||
R: ReportOffence<Reporter, Offender, O>,
|
||||
@@ -1164,7 +1164,7 @@ where
|
||||
if bonded_eras.first().filter(|(_, start)| offence_session >= *start).is_some() {
|
||||
R::report_offence(reporters, offence)
|
||||
} else {
|
||||
<Pallet<T>>::deposit_event(Event::<T>::OldSlashingReportDiscarded {
|
||||
<Pezpallet<T>>::deposit_event(Event::<T>::OldSlashingReportDiscarded {
|
||||
session_index: offence_session,
|
||||
});
|
||||
Ok(())
|
||||
@@ -1410,7 +1410,7 @@ impl<T: Config> Contains<T::AccountId> for AllStakers<T> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Configurations of the benchmarking of the pallet.
|
||||
/// Configurations of the benchmarking of the pezpallet.
|
||||
pub trait BenchmarkingConfig {
|
||||
/// The maximum number of validators to use.
|
||||
type MaxValidators: Get<u32>;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
|
||||
//! Storage migrations for the Staking pallet. The changelog for this is maintained at
|
||||
//! Storage migrations for the Staking pezpallet. The changelog for this is maintained at
|
||||
//! [CHANGELOG.md](https://github.com/pezkuwichain/pezkuwi-sdk/blob/master/bizinikiwi/pezframe/staking/CHANGELOG.md).
|
||||
|
||||
use super::*;
|
||||
@@ -39,7 +39,7 @@ enum ObsoleteReleases {
|
||||
V8_0_0, // populate `VoterList`.
|
||||
V9_0_0, // inject validators into `VoterList` as well.
|
||||
V10_0_0, // remove `EarliestUnappliedSlash`.
|
||||
V11_0_0, // Move pallet storage prefix, e.g. BagsList -> VoterBagsList
|
||||
V11_0_0, // Move pezpallet storage prefix, e.g. BagsList -> VoterBagsList
|
||||
V12_0_0, // remove `HistoryDepth`.
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ impl Default for ObsoleteReleases {
|
||||
|
||||
/// Alias to the old storage item used for release versioning. Obsolete since v13.
|
||||
#[storage_alias]
|
||||
type StorageVersion<T: Config> = StorageValue<Pallet<T>, ObsoleteReleases, ValueQuery>;
|
||||
type StorageVersion<T: Config> = StorageValue<Pezpallet<T>, ObsoleteReleases, ValueQuery>;
|
||||
|
||||
/// Supports the migration of Validator Disabling from pezpallet-staking to pezpallet-session
|
||||
pub mod v17 {
|
||||
@@ -59,7 +59,7 @@ pub mod v17 {
|
||||
|
||||
#[pezframe_support::storage_alias]
|
||||
pub type DisabledValidators<T: Config> =
|
||||
StorageValue<Pallet<T>, BoundedVec<(u32, OffenceSeverity), ConstU32<333>>, ValueQuery>;
|
||||
StorageValue<Pezpallet<T>, BoundedVec<(u32, OffenceSeverity), ConstU32<333>>, ValueQuery>;
|
||||
|
||||
pub struct MigrateDisabledToSession<T>(core::marker::PhantomData<T>);
|
||||
impl<T: Config> pezpallet_session::migrations::v1::MigrateDisabledValidators
|
||||
@@ -84,7 +84,7 @@ pub mod v16 {
|
||||
|
||||
#[pezframe_support::storage_alias]
|
||||
pub(crate) type DisabledValidators<T: Config> =
|
||||
StorageValue<Pallet<T>, Vec<(u32, OffenceSeverity)>, ValueQuery>;
|
||||
StorageValue<Pezpallet<T>, Vec<(u32, OffenceSeverity)>, ValueQuery>;
|
||||
|
||||
pub struct VersionUncheckedMigrateV15ToV16<T>(core::marker::PhantomData<T>);
|
||||
impl<T: Config> UncheckedOnRuntimeUpgrade for VersionUncheckedMigrateV15ToV16<T> {
|
||||
@@ -148,7 +148,7 @@ pub mod v16 {
|
||||
15,
|
||||
16,
|
||||
VersionUncheckedMigrateV15ToV16<T>,
|
||||
Pallet<T>,
|
||||
Pezpallet<T>,
|
||||
<T as pezframe_system::Config>::DbWeight,
|
||||
>;
|
||||
}
|
||||
@@ -157,11 +157,11 @@ pub mod v16 {
|
||||
pub mod v15 {
|
||||
use super::*;
|
||||
|
||||
// The disabling strategy used by staking pallet
|
||||
// The disabling strategy used by staking pezpallet
|
||||
type DefaultDisablingStrategy = pezpallet_session::disabling::UpToLimitDisablingStrategy;
|
||||
|
||||
#[storage_alias]
|
||||
pub(crate) type DisabledValidators<T: Config> = StorageValue<Pallet<T>, Vec<u32>, ValueQuery>;
|
||||
pub(crate) type DisabledValidators<T: Config> = StorageValue<Pezpallet<T>, Vec<u32>, ValueQuery>;
|
||||
|
||||
pub struct VersionUncheckedMigrateV14ToV15<T>(core::marker::PhantomData<T>);
|
||||
impl<T: Config> UncheckedOnRuntimeUpgrade for VersionUncheckedMigrateV14ToV15<T> {
|
||||
@@ -197,7 +197,7 @@ pub mod v15 {
|
||||
14,
|
||||
15,
|
||||
VersionUncheckedMigrateV14ToV15<T>,
|
||||
Pallet<T>,
|
||||
Pezpallet<T>,
|
||||
<T as pezframe_system::Config>::DbWeight,
|
||||
>;
|
||||
}
|
||||
@@ -209,16 +209,16 @@ pub mod v14 {
|
||||
|
||||
#[pezframe_support::storage_alias]
|
||||
pub(crate) type OffendingValidators<T: Config> =
|
||||
StorageValue<Pallet<T>, Vec<(u32, bool)>, ValueQuery>;
|
||||
StorageValue<Pezpallet<T>, Vec<(u32, bool)>, ValueQuery>;
|
||||
|
||||
pub struct MigrateToV14<T>(core::marker::PhantomData<T>);
|
||||
impl<T: Config> OnRuntimeUpgrade for MigrateToV14<T> {
|
||||
fn on_runtime_upgrade() -> Weight {
|
||||
let in_code = Pallet::<T>::in_code_storage_version();
|
||||
let on_chain = Pallet::<T>::on_chain_storage_version();
|
||||
let in_code = Pezpallet::<T>::in_code_storage_version();
|
||||
let on_chain = Pezpallet::<T>::on_chain_storage_version();
|
||||
|
||||
if in_code == 14 && on_chain == 13 {
|
||||
in_code.put::<Pallet<T>>();
|
||||
in_code.put::<Pezpallet<T>>();
|
||||
|
||||
log!(info, "staking v14 applied successfully.");
|
||||
T::DbWeight::get().reads_writes(1, 1)
|
||||
@@ -231,7 +231,7 @@ pub mod v14 {
|
||||
#[cfg(feature = "try-runtime")]
|
||||
fn post_upgrade(_state: Vec<u8>) -> Result<(), TryRuntimeError> {
|
||||
pezframe_support::ensure!(
|
||||
Pallet::<T>::on_chain_storage_version() >= 14,
|
||||
Pezpallet::<T>::on_chain_storage_version() >= 14,
|
||||
"v14 not applied"
|
||||
);
|
||||
Ok(())
|
||||
@@ -255,12 +255,12 @@ pub mod v13 {
|
||||
}
|
||||
|
||||
fn on_runtime_upgrade() -> Weight {
|
||||
let in_code = Pallet::<T>::in_code_storage_version();
|
||||
let in_code = Pezpallet::<T>::in_code_storage_version();
|
||||
let onchain = StorageVersion::<T>::get();
|
||||
|
||||
if in_code == 13 && onchain == ObsoleteReleases::V12_0_0 {
|
||||
StorageVersion::<T>::kill();
|
||||
in_code.put::<Pallet<T>>();
|
||||
in_code.put::<Pezpallet<T>>();
|
||||
|
||||
log!(info, "v13 applied successfully");
|
||||
T::DbWeight::get().reads_writes(1, 2)
|
||||
@@ -273,7 +273,7 @@ pub mod v13 {
|
||||
#[cfg(feature = "try-runtime")]
|
||||
fn post_upgrade(_state: Vec<u8>) -> Result<(), TryRuntimeError> {
|
||||
pezframe_support::ensure!(
|
||||
Pallet::<T>::on_chain_storage_version() == 13,
|
||||
Pezpallet::<T>::on_chain_storage_version() == 13,
|
||||
"v13 not applied"
|
||||
);
|
||||
|
||||
@@ -292,7 +292,7 @@ pub mod v12 {
|
||||
use pezframe_support::{pezpallet_prelude::ValueQuery, storage_alias};
|
||||
|
||||
#[storage_alias]
|
||||
type HistoryDepth<T: Config> = StorageValue<Pallet<T>, u32, ValueQuery>;
|
||||
type HistoryDepth<T: Config> = StorageValue<Pezpallet<T>, u32, ValueQuery>;
|
||||
|
||||
/// Clean up `T::HistoryDepth` from storage.
|
||||
///
|
||||
@@ -366,13 +366,13 @@ pub mod v11 {
|
||||
|
||||
pezframe_support::ensure!(
|
||||
pezsp_io::storage::next_key(&old_pallet_prefix).is_some(),
|
||||
"no data for the old pallet name has been detected"
|
||||
"no data for the old pezpallet name has been detected"
|
||||
);
|
||||
|
||||
Ok(Default::default())
|
||||
}
|
||||
|
||||
/// Migrate the entire storage of this pallet to a new prefix.
|
||||
/// Migrate the entire storage of this pezpallet to a new prefix.
|
||||
///
|
||||
/// This new prefix must be the same as the one set in construct_runtime. For safety, use
|
||||
/// `PalletInfo` to get it, as:
|
||||
@@ -413,7 +413,7 @@ pub mod v11 {
|
||||
let old_pallet_name = N::get();
|
||||
let new_pallet_name = <P as PalletInfoAccess>::name();
|
||||
|
||||
// skip storage prefix checks for the same pallet names
|
||||
// skip storage prefix checks for the same pezpallet names
|
||||
if new_pallet_name == old_pallet_name {
|
||||
return Ok(());
|
||||
}
|
||||
@@ -421,14 +421,14 @@ pub mod v11 {
|
||||
let old_pallet_prefix = twox_128(N::get().as_bytes());
|
||||
pezframe_support::ensure!(
|
||||
pezsp_io::storage::next_key(&old_pallet_prefix).is_none(),
|
||||
"old pallet data hasn't been removed"
|
||||
"old pezpallet data hasn't been removed"
|
||||
);
|
||||
|
||||
let new_pallet_name = <P as PalletInfoAccess>::name();
|
||||
let new_pallet_prefix = twox_128(new_pallet_name.as_bytes());
|
||||
pezframe_support::ensure!(
|
||||
pezsp_io::storage::next_key(&new_pallet_prefix).is_some(),
|
||||
"new pallet data hasn't been created"
|
||||
"new pezpallet data hasn't been created"
|
||||
);
|
||||
|
||||
Ok(())
|
||||
|
||||
@@ -285,7 +285,7 @@ impl Contains<AccountId> for MockedRestrictList {
|
||||
pub(crate) const DISABLING_LIMIT_FACTOR: usize = 3;
|
||||
|
||||
#[derive_impl(crate::config_preludes::TestDefaultConfig)]
|
||||
impl crate::pallet::pallet::Config for Test {
|
||||
impl crate::pezpallet::pezpallet::Config for Test {
|
||||
type OldCurrency = Balances;
|
||||
type Currency = Balances;
|
||||
type UnixTime = Timestamp;
|
||||
@@ -470,7 +470,7 @@ impl ExtBuilder {
|
||||
(40, self.balance_factor),
|
||||
(50, self.balance_factor),
|
||||
// stashes
|
||||
// Note: Previously this pallet used locks and stakers could stake all their
|
||||
// Note: Previously this pezpallet used locks and stakers could stake all their
|
||||
// balance including ED. Now with holds, stakers are required to maintain
|
||||
// (non-staked) ED in their accounts. Therefore, we drop an additional existential
|
||||
// deposit to genesis stakers.
|
||||
@@ -726,7 +726,7 @@ pub(crate) fn reward_time_per_era() -> u64 {
|
||||
pub(crate) fn reward_all_elected() {
|
||||
let rewards = <Test as Config>::SessionInterface::validators().into_iter().map(|v| (v, 1));
|
||||
|
||||
<Pallet<Test>>::reward_by_ids(rewards)
|
||||
<Pezpallet<Test>>::reward_by_ids(rewards)
|
||||
}
|
||||
|
||||
pub(crate) fn validator_controllers() -> Vec<AccountId> {
|
||||
|
||||
+33
-33
@@ -15,7 +15,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! Implementations for the Staking FRAME Pallet.
|
||||
//! Implementations for the Staking FRAME Pezpallet.
|
||||
|
||||
use pezframe_election_provider_support::{
|
||||
bounds::{CountBound, SizeBound},
|
||||
@@ -57,7 +57,7 @@ use crate::{
|
||||
};
|
||||
use alloc::{boxed::Box, vec, vec::Vec};
|
||||
|
||||
use super::pallet::*;
|
||||
use super::pezpallet::*;
|
||||
|
||||
#[cfg(feature = "try-runtime")]
|
||||
use pezframe_support::ensure;
|
||||
@@ -72,7 +72,7 @@ use pezsp_runtime::TryRuntimeError;
|
||||
/// times and then give up.
|
||||
const NPOS_MAX_ITERATIONS_COEFFICIENT: u32 = 2;
|
||||
|
||||
impl<T: Config> Pallet<T> {
|
||||
impl<T: Config> Pezpallet<T> {
|
||||
/// Fetches the ledger associated with a controller or stash account, if any.
|
||||
pub fn ledger(account: StakingAccount<T::AccountId>) -> Result<StakingLedger<T>, Error<T>> {
|
||||
StakingLedger::<T>::get(account)
|
||||
@@ -146,7 +146,7 @@ impl<T: Config> Pallet<T> {
|
||||
/// This prevents call sites from repeatedly requesting `total_issuance` from backend. But it is
|
||||
/// important to be only used while the total issuance is not changing.
|
||||
pub fn weight_of_fn() -> Box<dyn Fn(&T::AccountId) -> VoteWeight> {
|
||||
// NOTE: changing this to unboxed `impl Fn(..)` return type and the pallet will still
|
||||
// NOTE: changing this to unboxed `impl Fn(..)` return type and the pezpallet will still
|
||||
// compile, while some types in mock fail to resolve.
|
||||
let issuance = asset::total_issuance::<T>();
|
||||
Box::new(move |who: &T::AccountId| -> VoteWeight {
|
||||
@@ -505,7 +505,7 @@ impl<T: Config> Pallet<T> {
|
||||
Self::start_era(start_session);
|
||||
} else if next_active_era_start_session_index < start_session {
|
||||
// This arm should never happen, but better handle it than to stall the staking
|
||||
// pallet.
|
||||
// pezpallet.
|
||||
pezframe_support::print("Warning: A session appears to have been skipped.");
|
||||
Self::start_era(start_session);
|
||||
}
|
||||
@@ -642,7 +642,7 @@ impl<T: Config> Pallet<T> {
|
||||
is_genesis: bool,
|
||||
) -> Option<BoundedVec<T::AccountId, MaxWinnersOf<T>>> {
|
||||
let election_result = if is_genesis {
|
||||
// This pallet only supports single page elections.
|
||||
// This pezpallet only supports single page elections.
|
||||
let result = <T::GenesisElectionProvider>::elect(0)
|
||||
.map_err(|e| {
|
||||
log!(warn, "genesis election provider failed due to {:?}", e);
|
||||
@@ -652,7 +652,7 @@ impl<T: Config> Pallet<T> {
|
||||
|
||||
BoundedSupportsOf::<T::ElectionProvider>::try_from_other_bounds(result).ok()?
|
||||
} else {
|
||||
// This pallet only supports single page elections.
|
||||
// This pezpallet only supports single page elections.
|
||||
<T::ElectionProvider>::elect(0)
|
||||
.map_err(|e| {
|
||||
log!(warn, "election provider failed due to {:?}", e);
|
||||
@@ -1134,11 +1134,11 @@ impl<T: Config> Pallet<T> {
|
||||
outcome
|
||||
}
|
||||
|
||||
/// Register some amount of weight directly with the system pallet.
|
||||
/// Register some amount of weight directly with the system pezpallet.
|
||||
///
|
||||
/// This is always mandatory weight.
|
||||
fn register_weight(weight: Weight) {
|
||||
<pezframe_system::Pallet<T>>::register_extra_weight_unchecked(
|
||||
<pezframe_system::Pezpallet<T>>::register_extra_weight_unchecked(
|
||||
weight,
|
||||
DispatchClass::Mandatory,
|
||||
);
|
||||
@@ -1168,7 +1168,7 @@ impl<T: Config> Pallet<T> {
|
||||
T::OldCurrency::remove_lock(STAKING_ID, &stash);
|
||||
|
||||
// Get rid of the extra consumer we used to have with OldCurrency.
|
||||
pezframe_system::Pallet::<T>::dec_consumers(&stash);
|
||||
pezframe_system::Pezpallet::<T>::dec_consumers(&stash);
|
||||
|
||||
let Ok(ledger) = Self::ledger(Stash(stash.clone())) else {
|
||||
// User is no longer bonded. Removing the lock is enough.
|
||||
@@ -1207,7 +1207,7 @@ impl<T: Config> Pallet<T> {
|
||||
// necessary. However, this is a good opportunity to clean up the extra consumer/providers that
|
||||
// were previously used.
|
||||
fn do_migrate_virtual_staker(stash: &T::AccountId) -> DispatchResult {
|
||||
let consumer_count = pezframe_system::Pallet::<T>::consumers(stash);
|
||||
let consumer_count = pezframe_system::Pezpallet::<T>::consumers(stash);
|
||||
// fail early if no consumers.
|
||||
ensure!(consumer_count > 0, Error::<T>::AlreadyMigrated);
|
||||
|
||||
@@ -1218,11 +1218,11 @@ impl<T: Config> Pallet<T> {
|
||||
|
||||
// get rid of the consumers
|
||||
for _ in 0..consumer_count {
|
||||
pezframe_system::Pallet::<T>::dec_consumers(&stash);
|
||||
pezframe_system::Pezpallet::<T>::dec_consumers(&stash);
|
||||
}
|
||||
|
||||
// get the current count of providers
|
||||
let actual_providers = pezframe_system::Pallet::<T>::providers(stash);
|
||||
let actual_providers = pezframe_system::Pezpallet::<T>::providers(stash);
|
||||
|
||||
let expected_providers =
|
||||
// We expect these accounts to have only one provider, and hold no balance. However, if
|
||||
@@ -1240,7 +1240,7 @@ impl<T: Config> Pallet<T> {
|
||||
// if actual provider is less than expected, it is already migrated.
|
||||
ensure!(actual_providers == expected_providers, Error::<T>::AlreadyMigrated);
|
||||
|
||||
pezframe_system::Pallet::<T>::dec_providers(&stash)?;
|
||||
pezframe_system::Pezpallet::<T>::dec_providers(&stash)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@@ -1468,7 +1468,7 @@ impl<T: Config> Pallet<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> Pallet<T> {
|
||||
impl<T: Config> Pezpallet<T> {
|
||||
/// Returns the current nominations quota for nominators.
|
||||
///
|
||||
/// Used by the runtime API.
|
||||
@@ -1492,7 +1492,7 @@ impl<T: Config> Pallet<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> ElectionDataProvider for Pallet<T> {
|
||||
impl<T: Config> ElectionDataProvider for Pezpallet<T> {
|
||||
type AccountId = T::AccountId;
|
||||
type BlockNumber = BlockNumberFor<T>;
|
||||
type MaxVotesPerVoter = MaxNominationsOf<T>;
|
||||
@@ -1647,7 +1647,7 @@ impl<T: Config> ElectionDataProvider for Pallet<T> {
|
||||
///
|
||||
/// Once the first new_session is planned, all session must start and then end in order, though
|
||||
/// some session can lag in between the newest session planned and the latest session started.
|
||||
impl<T: Config> pezpallet_session::SessionManager<T::AccountId> for Pallet<T> {
|
||||
impl<T: Config> pezpallet_session::SessionManager<T::AccountId> for Pezpallet<T> {
|
||||
fn new_session(new_index: SessionIndex) -> Option<Vec<T::AccountId>> {
|
||||
log!(trace, "planning new session {}", new_index);
|
||||
CurrentPlannedSession::<T>::put(new_index);
|
||||
@@ -1669,7 +1669,7 @@ impl<T: Config> pezpallet_session::SessionManager<T::AccountId> for Pallet<T> {
|
||||
}
|
||||
|
||||
impl<T: Config> historical::SessionManager<T::AccountId, Exposure<T::AccountId, BalanceOf<T>>>
|
||||
for Pallet<T>
|
||||
for Pezpallet<T>
|
||||
{
|
||||
fn new_session(
|
||||
new_index: SessionIndex,
|
||||
@@ -1707,7 +1707,7 @@ impl<T: Config> historical::SessionManager<T::AccountId, Exposure<T::AccountId,
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> historical::SessionManager<T::AccountId, ()> for Pallet<T> {
|
||||
impl<T: Config> historical::SessionManager<T::AccountId, ()> for Pezpallet<T> {
|
||||
fn new_session(new_index: SessionIndex) -> Option<Vec<(T::AccountId, ())>> {
|
||||
<Self as pezpallet_session::SessionManager<_>>::new_session(new_index)
|
||||
.map(|validators| validators.into_iter().map(|v| (v, ())).collect())
|
||||
@@ -1726,7 +1726,7 @@ impl<T: Config> historical::SessionManager<T::AccountId, ()> for Pallet<T> {
|
||||
|
||||
/// Add reward points to block authors:
|
||||
/// * 20 points to the block producer for producing a (non-uncle) block,
|
||||
impl<T> pezpallet_authorship::EventHandler<T::AccountId, BlockNumberFor<T>> for Pallet<T>
|
||||
impl<T> pezpallet_authorship::EventHandler<T::AccountId, BlockNumberFor<T>> for Pezpallet<T>
|
||||
where
|
||||
T: Config + pezpallet_authorship::Config + pezpallet_session::Config,
|
||||
{
|
||||
@@ -1738,7 +1738,7 @@ where
|
||||
/// This is intended to be used with `FilterHistoricalOffences`.
|
||||
impl<T: Config>
|
||||
OnOffenceHandler<T::AccountId, pezpallet_session::historical::IdentificationTuple<T>, Weight>
|
||||
for Pallet<T>
|
||||
for Pezpallet<T>
|
||||
where
|
||||
T: pezpallet_session::Config<ValidatorId = <T as pezframe_system::Config>::AccountId>,
|
||||
T: pezpallet_session::historical::Config,
|
||||
@@ -1775,7 +1775,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> ScoreProvider<T::AccountId> for Pallet<T> {
|
||||
impl<T: Config> ScoreProvider<T::AccountId> for Pezpallet<T> {
|
||||
type Score = VoteWeight;
|
||||
|
||||
fn score(who: &T::AccountId) -> Option<Self::Score> {
|
||||
@@ -1845,7 +1845,7 @@ impl<T: Config> SortedListProvider<T::AccountId> for UseValidatorsMap<T> {
|
||||
Ok(())
|
||||
}
|
||||
fn get_score(id: &T::AccountId) -> Result<Self::Score, Self::Error> {
|
||||
Ok(Pallet::<T>::weight_of(id).into())
|
||||
Ok(Pezpallet::<T>::weight_of(id).into())
|
||||
}
|
||||
fn on_update(_: &T::AccountId, _weight: Self::Score) -> Result<(), Self::Error> {
|
||||
// nothing to do on update.
|
||||
@@ -1925,7 +1925,7 @@ impl<T: Config> SortedListProvider<T::AccountId> for UseNominatorsAndValidatorsM
|
||||
Ok(())
|
||||
}
|
||||
fn get_score(id: &T::AccountId) -> Result<Self::Score, Self::Error> {
|
||||
Ok(Pallet::<T>::weight_of(id))
|
||||
Ok(Pezpallet::<T>::weight_of(id))
|
||||
}
|
||||
fn on_update(_: &T::AccountId, _weight: Self::Score) -> Result<(), Self::Error> {
|
||||
// nothing to do on update.
|
||||
@@ -1967,7 +1967,7 @@ impl<T: Config> SortedListProvider<T::AccountId> for UseNominatorsAndValidatorsM
|
||||
fn unlock() {}
|
||||
}
|
||||
|
||||
impl<T: Config> StakingInterface for Pallet<T> {
|
||||
impl<T: Config> StakingInterface for Pezpallet<T> {
|
||||
type AccountId = T::AccountId;
|
||||
type Balance = BalanceOf<T>;
|
||||
type CurrencyToVote = T::CurrencyToVote;
|
||||
@@ -2012,7 +2012,7 @@ impl<T: Config> StakingInterface for Pallet<T> {
|
||||
}
|
||||
|
||||
fn set_payee(stash: &Self::AccountId, reward_acc: &Self::AccountId) -> DispatchResult {
|
||||
// Since virtual stakers are not allowed to compound their rewards as this pallet does not
|
||||
// Since virtual stakers are not allowed to compound their rewards as this pezpallet does not
|
||||
// manage their locks, we do not allow reward account to be set same as stash. For
|
||||
// external pallets that manage the virtual bond, they can claim rewards and re-bond them.
|
||||
ensure!(
|
||||
@@ -2113,12 +2113,12 @@ impl<T: Config> StakingInterface for Pallet<T> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Whether `who` is a virtual staker whose funds are managed by another pallet.
|
||||
/// Whether `who` is a virtual staker whose funds are managed by another pezpallet.
|
||||
///
|
||||
/// There is an assumption that, this account is keyless and managed by another pallet in the
|
||||
/// There is an assumption that, this account is keyless and managed by another pezpallet in the
|
||||
/// runtime. Hence, it can never sign its own transactions.
|
||||
fn is_virtual_staker(who: &T::AccountId) -> bool {
|
||||
pezframe_system::Pallet::<T>::account_nonce(who).is_zero() &&
|
||||
pezframe_system::Pezpallet::<T>::account_nonce(who).is_zero() &&
|
||||
VirtualStakers::<T>::contains_key(who)
|
||||
}
|
||||
|
||||
@@ -2154,7 +2154,7 @@ impl<T: Config> StakingInterface for Pallet<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> pezsp_staking::StakingUnchecked for Pallet<T> {
|
||||
impl<T: Config> pezsp_staking::StakingUnchecked for Pezpallet<T> {
|
||||
fn migrate_to_virtual_staker(who: &Self::AccountId) -> DispatchResult {
|
||||
asset::kill_stake::<T>(who)?;
|
||||
VirtualStakers::<T>::insert(who, ());
|
||||
@@ -2198,14 +2198,14 @@ impl<T: Config> pezsp_staking::StakingUnchecked for Pallet<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> RewardsReporter<T::AccountId> for Pallet<T> {
|
||||
impl<T: Config> RewardsReporter<T::AccountId> for Pezpallet<T> {
|
||||
fn reward_by_ids(validators_points: impl IntoIterator<Item = (T::AccountId, u32)>) {
|
||||
Self::reward_by_ids(validators_points)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(test, feature = "try-runtime"))]
|
||||
impl<T: Config> Pallet<T> {
|
||||
impl<T: Config> Pezpallet<T> {
|
||||
pub(crate) fn do_try_state(_: BlockNumberFor<T>) -> Result<(), TryRuntimeError> {
|
||||
ensure!(
|
||||
T::VoterList::iter()
|
||||
@@ -2356,7 +2356,7 @@ impl<T: Config> Pallet<T> {
|
||||
"ledger corrupted for virtual staker"
|
||||
);
|
||||
ensure!(
|
||||
pezframe_system::Pallet::<T>::account_nonce(&stash).is_zero(),
|
||||
pezframe_system::Pezpallet::<T>::account_nonce(&stash).is_zero(),
|
||||
"virtual stakers are keyless and should not have any nonce"
|
||||
);
|
||||
let reward_destination = <Payee<T>>::get(stash.clone()).unwrap();
|
||||
+179
-179
@@ -15,7 +15,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! Staking FRAME Pallet.
|
||||
//! Staking FRAME Pezpallet.
|
||||
|
||||
use alloc::vec::Vec;
|
||||
use codec::Codec;
|
||||
@@ -61,8 +61,8 @@ use crate::{
|
||||
// account which is not provided as an input. The value set should be conservative but sensible.
|
||||
pub(crate) const SPECULATIVE_NUM_SPANS: u32 = 32;
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
pub mod pallet {
|
||||
#[pezframe_support::pezpallet]
|
||||
pub mod pezpallet {
|
||||
use super::*;
|
||||
use codec::HasCompact;
|
||||
use pezframe_election_provider_support::ElectionDataProvider;
|
||||
@@ -72,11 +72,11 @@ pub mod pallet {
|
||||
/// The in-code storage version.
|
||||
const STORAGE_VERSION: StorageVersion = StorageVersion::new(16);
|
||||
|
||||
#[pallet::pallet]
|
||||
#[pallet::storage_version(STORAGE_VERSION)]
|
||||
pub struct Pallet<T>(_);
|
||||
#[pezpallet::pezpallet]
|
||||
#[pezpallet::storage_version(STORAGE_VERSION)]
|
||||
pub struct Pezpallet<T>(_);
|
||||
|
||||
/// Possible operations on the configuration values of this pallet.
|
||||
/// Possible operations on the configuration values of this pezpallet.
|
||||
#[derive(TypeInfo, Debug, Clone, Encode, Decode, DecodeWithMemTracking, PartialEq)]
|
||||
pub enum ConfigOp<T: Default + Codec> {
|
||||
/// Don't change.
|
||||
@@ -87,10 +87,10 @@ pub mod pallet {
|
||||
Remove,
|
||||
}
|
||||
|
||||
#[pallet::config(with_default)]
|
||||
#[pezpallet::config(with_default)]
|
||||
pub trait Config: pezframe_system::Config {
|
||||
/// The old trait for staking balance. Deprecated and only used for migrating old ledgers.
|
||||
#[pallet::no_default]
|
||||
#[pezpallet::no_default]
|
||||
type OldCurrency: InspectLockableCurrency<
|
||||
Self::AccountId,
|
||||
Moment = BlockNumberFor<Self>,
|
||||
@@ -98,7 +98,7 @@ pub mod pallet {
|
||||
>;
|
||||
|
||||
/// The staking balance.
|
||||
#[pallet::no_default]
|
||||
#[pezpallet::no_default]
|
||||
type Currency: FunHoldMutate<
|
||||
Self::AccountId,
|
||||
Reason = Self::RuntimeHoldReason,
|
||||
@@ -107,7 +107,7 @@ pub mod pallet {
|
||||
+ FunHoldBalanced<Self::AccountId, Balance = Self::CurrencyBalance>;
|
||||
|
||||
/// Overarching hold reason.
|
||||
#[pallet::no_default_bounds]
|
||||
#[pezpallet::no_default_bounds]
|
||||
type RuntimeHoldReason: From<HoldReason>;
|
||||
|
||||
/// Just the `Currency::Balance` type; we have this item to allow us to constrain it to
|
||||
@@ -129,7 +129,7 @@ pub mod pallet {
|
||||
///
|
||||
/// It is guaranteed to start being called from the first `on_finalize`. Thus value at
|
||||
/// genesis is not used.
|
||||
#[pallet::no_default]
|
||||
#[pezpallet::no_default]
|
||||
type UnixTime: UnixTime;
|
||||
|
||||
/// Convert a balance into a number used for election calculation. This must fit into a
|
||||
@@ -138,27 +138,27 @@ pub mod pallet {
|
||||
/// in 128.
|
||||
/// Consequently, the backward convert is used convert the u128s from sp-elections back to a
|
||||
/// [`BalanceOf`].
|
||||
#[pallet::no_default_bounds]
|
||||
#[pezpallet::no_default_bounds]
|
||||
type CurrencyToVote: pezsp_staking::currency_to_vote::CurrencyToVote<BalanceOf<Self>>;
|
||||
|
||||
/// Something that provides the election functionality.
|
||||
#[pallet::no_default]
|
||||
#[pezpallet::no_default]
|
||||
type ElectionProvider: ElectionProvider<
|
||||
AccountId = Self::AccountId,
|
||||
BlockNumber = BlockNumberFor<Self>,
|
||||
// we only accept an election provider that has staking as data provider.
|
||||
DataProvider = Pallet<Self>,
|
||||
DataProvider = Pezpallet<Self>,
|
||||
>;
|
||||
/// Something that provides the election functionality at genesis.
|
||||
#[pallet::no_default]
|
||||
#[pezpallet::no_default]
|
||||
type GenesisElectionProvider: ElectionProvider<
|
||||
AccountId = Self::AccountId,
|
||||
BlockNumber = BlockNumberFor<Self>,
|
||||
DataProvider = Pallet<Self>,
|
||||
DataProvider = Pezpallet<Self>,
|
||||
>;
|
||||
|
||||
/// Something that defines the maximum number of nominations per nominator.
|
||||
#[pallet::no_default_bounds]
|
||||
#[pezpallet::no_default_bounds]
|
||||
type NominationsQuota: NominationsQuota<BalanceOf<Self>>;
|
||||
|
||||
/// Number of eras to keep in history.
|
||||
@@ -173,7 +173,7 @@ pub mod pallet {
|
||||
/// I.e. active era must always be in history. I.e. `active_era >
|
||||
/// current_era - history_depth` must be guaranteed.
|
||||
///
|
||||
/// If migrating an existing pallet from storage value to config value,
|
||||
/// If migrating an existing pezpallet from storage value to config value,
|
||||
/// this should be set to same value or greater as in storage.
|
||||
///
|
||||
/// Note: `HistoryDepth` is used as the upper bound for the `BoundedVec`
|
||||
@@ -181,61 +181,61 @@ pub mod pallet {
|
||||
/// the existing value can lead to inconsistencies in the
|
||||
/// `StakingLedger` and will need to be handled properly in a migration.
|
||||
/// The test `reducing_history_depth_abrupt` shows this effect.
|
||||
#[pallet::constant]
|
||||
#[pezpallet::constant]
|
||||
type HistoryDepth: Get<u32>;
|
||||
|
||||
/// Tokens have been minted and are unused for validator-reward.
|
||||
/// See [Era payout](./index.html#era-payout).
|
||||
#[pallet::no_default_bounds]
|
||||
#[pezpallet::no_default_bounds]
|
||||
type RewardRemainder: OnUnbalanced<NegativeImbalanceOf<Self>>;
|
||||
|
||||
/// The overarching event type.
|
||||
#[pallet::no_default_bounds]
|
||||
#[pezpallet::no_default_bounds]
|
||||
#[allow(deprecated)]
|
||||
type RuntimeEvent: From<Event<Self>> + IsType<<Self as pezframe_system::Config>::RuntimeEvent>;
|
||||
|
||||
/// Handler for the unbalanced reduction when slashing a staker.
|
||||
#[pallet::no_default_bounds]
|
||||
#[pezpallet::no_default_bounds]
|
||||
type Slash: OnUnbalanced<NegativeImbalanceOf<Self>>;
|
||||
|
||||
/// Handler for the unbalanced increment when rewarding a staker.
|
||||
/// NOTE: in most cases, the implementation of `OnUnbalanced` should modify the total
|
||||
/// issuance.
|
||||
#[pallet::no_default_bounds]
|
||||
#[pezpallet::no_default_bounds]
|
||||
type Reward: OnUnbalanced<PositiveImbalanceOf<Self>>;
|
||||
|
||||
/// Number of sessions per era.
|
||||
#[pallet::constant]
|
||||
#[pezpallet::constant]
|
||||
type SessionsPerEra: Get<SessionIndex>;
|
||||
|
||||
/// Number of eras that staked funds must remain bonded for.
|
||||
#[pallet::constant]
|
||||
#[pezpallet::constant]
|
||||
type BondingDuration: Get<EraIndex>;
|
||||
|
||||
/// Number of eras that slashes are deferred by, after computation.
|
||||
///
|
||||
/// This should be less than the bonding duration. Set to 0 if slashes
|
||||
/// should be applied immediately, without opportunity for intervention.
|
||||
#[pallet::constant]
|
||||
#[pezpallet::constant]
|
||||
type SlashDeferDuration: Get<EraIndex>;
|
||||
|
||||
/// The origin which can manage less critical staking parameters that does not require root.
|
||||
///
|
||||
/// Supported actions: (1) cancel deferred slash, (2) set minimum commission.
|
||||
#[pallet::no_default]
|
||||
#[pezpallet::no_default]
|
||||
type AdminOrigin: EnsureOrigin<Self::RuntimeOrigin>;
|
||||
|
||||
/// Interface for interacting with a session pallet.
|
||||
/// Interface for interacting with a session pezpallet.
|
||||
type SessionInterface: SessionInterface<Self::AccountId>;
|
||||
|
||||
/// The payout for validators and the system for the current era.
|
||||
/// See [Era payout](./index.html#era-payout).
|
||||
#[pallet::no_default]
|
||||
#[pezpallet::no_default]
|
||||
type EraPayout: EraPayout<BalanceOf<Self>>;
|
||||
|
||||
/// Something that can estimate the next session change, accurately or as a best effort
|
||||
/// guess.
|
||||
#[pallet::no_default_bounds]
|
||||
#[pezpallet::no_default_bounds]
|
||||
type NextNewSession: EstimateNextNewSession<BlockNumberFor<Self>>;
|
||||
|
||||
/// The maximum size of each `T::ExposurePage`.
|
||||
@@ -249,11 +249,11 @@ pub mod pallet {
|
||||
///
|
||||
/// Note: `MaxExposurePageSize` is used to bound `ClaimedRewards` and is unsafe to reduce
|
||||
/// without handling it in a migration.
|
||||
#[pallet::constant]
|
||||
#[pezpallet::constant]
|
||||
type MaxExposurePageSize: Get<u32>;
|
||||
|
||||
/// The absolute maximum of winner validators this pallet should return.
|
||||
#[pallet::constant]
|
||||
/// The absolute maximum of winner validators this pezpallet should return.
|
||||
#[pezpallet::constant]
|
||||
type MaxValidatorSet: Get<u32>;
|
||||
|
||||
/// Something that provides a best-effort sorted list of voters aka electing nominators,
|
||||
@@ -267,7 +267,7 @@ pub mod pallet {
|
||||
/// staker. In case of `bags-list`, this always means using `rebag` and `putInFrontOf`.
|
||||
///
|
||||
/// Invariant: what comes out of this list will always be a nominator.
|
||||
#[pallet::no_default]
|
||||
#[pezpallet::no_default]
|
||||
type VoterList: SortedListProvider<Self::AccountId, Score = VoteWeight>;
|
||||
|
||||
/// WIP: This is a noop as of now, the actual business logic that's described below is going
|
||||
@@ -290,7 +290,7 @@ pub mod pallet {
|
||||
/// validators, they can chill at any point, and their approval stakes will still be
|
||||
/// recorded. This implies that what comes out of iterating this list MIGHT NOT BE AN ACTIVE
|
||||
/// VALIDATOR.
|
||||
#[pallet::no_default]
|
||||
#[pezpallet::no_default]
|
||||
type TargetList: SortedListProvider<Self::AccountId, Score = BalanceOf<Self>>;
|
||||
|
||||
/// The maximum number of `unlocking` chunks a [`StakingLedger`] can
|
||||
@@ -303,7 +303,7 @@ pub mod pallet {
|
||||
/// `StakingLedger` and will need to be handled properly in a runtime
|
||||
/// migration. The test `reducing_max_unlocking_chunks_abrupt` shows
|
||||
/// this effect.
|
||||
#[pallet::constant]
|
||||
#[pezpallet::constant]
|
||||
type MaxUnlockingChunks: Get<u32>;
|
||||
|
||||
/// The maximum amount of controller accounts that can be deprecated in one call.
|
||||
@@ -313,10 +313,10 @@ pub mod pallet {
|
||||
/// receives.
|
||||
///
|
||||
/// WARNING: this only reports slashing and withdraw events for the time being.
|
||||
#[pallet::no_default_bounds]
|
||||
#[pezpallet::no_default_bounds]
|
||||
type EventListeners: pezsp_staking::OnStakingUpdate<Self::AccountId, BalanceOf<Self>>;
|
||||
|
||||
#[pallet::no_default_bounds]
|
||||
#[pezpallet::no_default_bounds]
|
||||
/// Filter some accounts from participating in staking.
|
||||
///
|
||||
/// This is useful for example to blacklist an account that is participating in staking in
|
||||
@@ -328,15 +328,15 @@ pub mod pallet {
|
||||
type BenchmarkingConfig: BenchmarkingConfig;
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
#[pallet::no_default]
|
||||
#[pezpallet::no_default]
|
||||
type BenchmarkingConfig: BenchmarkingConfig;
|
||||
|
||||
/// Weight information for extrinsics in this pallet.
|
||||
/// Weight information for extrinsics in this pezpallet.
|
||||
type WeightInfo: WeightInfo;
|
||||
}
|
||||
|
||||
/// A reason for placing a hold on funds.
|
||||
#[pallet::composite_enum]
|
||||
#[pezpallet::composite_enum]
|
||||
pub enum HoldReason {
|
||||
/// Funds on stake by a nominator or a validator.
|
||||
#[codec(index = 0)]
|
||||
@@ -388,69 +388,69 @@ pub mod pallet {
|
||||
}
|
||||
|
||||
/// The ideal number of active validators.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type ValidatorCount<T> = StorageValue<_, u32, ValueQuery>;
|
||||
|
||||
/// Minimum number of staking participants before emergency conditions are imposed.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type MinimumValidatorCount<T> = StorageValue<_, u32, ValueQuery>;
|
||||
|
||||
/// Any validators that may never be slashed or forcibly kicked. It's a Vec since they're
|
||||
/// easy to initialize and the performance hit is minimal (we expect no more than four
|
||||
/// invulnerables) and restricted to testnets.
|
||||
#[pallet::storage]
|
||||
#[pallet::unbounded]
|
||||
#[pezpallet::storage]
|
||||
#[pezpallet::unbounded]
|
||||
pub type Invulnerables<T: Config> = StorageValue<_, Vec<T::AccountId>, ValueQuery>;
|
||||
|
||||
/// Map from all locked "stash" accounts to the controller account.
|
||||
///
|
||||
/// TWOX-NOTE: SAFE since `AccountId` is a secure hash.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type Bonded<T: Config> = StorageMap<_, Twox64Concat, T::AccountId, T::AccountId>;
|
||||
|
||||
/// The minimum active bond to become and maintain the role of a nominator.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type MinNominatorBond<T: Config> = StorageValue<_, BalanceOf<T>, ValueQuery>;
|
||||
|
||||
/// The minimum active bond to become and maintain the role of a validator.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type MinValidatorBond<T: Config> = StorageValue<_, BalanceOf<T>, ValueQuery>;
|
||||
|
||||
/// The minimum active nominator stake of the last successful election.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type MinimumActiveStake<T> = StorageValue<_, BalanceOf<T>, ValueQuery>;
|
||||
|
||||
/// The minimum amount of commission that validators can set.
|
||||
///
|
||||
/// If set to `0`, no limit exists.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type MinCommission<T: Config> = StorageValue<_, Perbill, ValueQuery>;
|
||||
|
||||
/// Map from all (unlocked) "controller" accounts to the info regarding the staking.
|
||||
///
|
||||
/// Note: All the reads and mutations to this storage *MUST* be done through the methods exposed
|
||||
/// by [`StakingLedger`] to ensure data and lock consistency.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type Ledger<T: Config> = StorageMap<_, Blake2_128Concat, T::AccountId, StakingLedger<T>>;
|
||||
|
||||
/// Where the reward payment should be made. Keyed by stash.
|
||||
///
|
||||
/// TWOX-NOTE: SAFE since `AccountId` is a secure hash.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type Payee<T: Config> =
|
||||
StorageMap<_, Twox64Concat, T::AccountId, RewardDestination<T::AccountId>, OptionQuery>;
|
||||
|
||||
/// The map from (wannabe) validator stash key to the preferences of that validator.
|
||||
///
|
||||
/// TWOX-NOTE: SAFE since `AccountId` is a secure hash.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type Validators<T: Config> =
|
||||
CountedStorageMap<_, Twox64Concat, T::AccountId, ValidatorPrefs, ValueQuery>;
|
||||
|
||||
/// The maximum validator count before we stop allowing new validators to join.
|
||||
///
|
||||
/// When this value is not set, no limits are enforced.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type MaxValidatorsCount<T> = StorageValue<_, u32, OptionQuery>;
|
||||
|
||||
/// The map from nominator stash key to their nomination preferences, namely the validators that
|
||||
@@ -472,44 +472,44 @@ pub mod pallet {
|
||||
/// [`Call::chill_other`] dispatchable by anyone.
|
||||
///
|
||||
/// TWOX-NOTE: SAFE since `AccountId` is a secure hash.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type Nominators<T: Config> =
|
||||
CountedStorageMap<_, Twox64Concat, T::AccountId, Nominations<T>>;
|
||||
|
||||
/// Stakers whose funds are managed by other pallets.
|
||||
///
|
||||
/// This pallet does not apply any locks on them, therefore they are only virtually bonded. They
|
||||
/// This pezpallet does not apply any locks on them, therefore they are only virtually bonded. They
|
||||
/// are expected to be keyless accounts and hence should not be allowed to mutate their ledger
|
||||
/// directly via this pallet. Instead, these accounts are managed by other pallets and accessed
|
||||
/// directly via this pezpallet. Instead, these accounts are managed by other pallets and accessed
|
||||
/// via low level apis. We keep track of them to do minimal integrity checks.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type VirtualStakers<T: Config> = CountedStorageMap<_, Twox64Concat, T::AccountId, ()>;
|
||||
|
||||
/// The maximum nominator count before we stop allowing new validators to join.
|
||||
///
|
||||
/// When this value is not set, no limits are enforced.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type MaxNominatorsCount<T> = StorageValue<_, u32, OptionQuery>;
|
||||
|
||||
/// The current era index.
|
||||
///
|
||||
/// This is the latest planned era, depending on how the Session pallet queues the validator
|
||||
/// This is the latest planned era, depending on how the Session pezpallet queues the validator
|
||||
/// set, it might be active or not.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type CurrentEra<T> = StorageValue<_, EraIndex>;
|
||||
|
||||
/// The active era information, it holds index and start.
|
||||
///
|
||||
/// The active era is the era being currently rewarded. Validator set of this era must be
|
||||
/// equal to [`SessionInterface::validators`].
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type ActiveEra<T> = StorageValue<_, ActiveEraInfo>;
|
||||
|
||||
/// The session index at which the era start for the last [`Config::HistoryDepth`] eras.
|
||||
///
|
||||
/// Note: This tracks the starting session (i.e. session index when era start being active)
|
||||
/// for the eras in `[CurrentEra - HISTORY_DEPTH, CurrentEra]`.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type ErasStartSessionIndex<T> = StorageMap<_, Twox64Concat, EraIndex, SessionIndex>;
|
||||
|
||||
/// Exposure of validator at era.
|
||||
@@ -520,8 +520,8 @@ pub mod pallet {
|
||||
/// If stakers hasn't been set or has been removed then empty exposure is returned.
|
||||
///
|
||||
/// Note: Deprecated since v14. Use `EraInfo` instead to work with exposures.
|
||||
#[pallet::storage]
|
||||
#[pallet::unbounded]
|
||||
#[pezpallet::storage]
|
||||
#[pezpallet::unbounded]
|
||||
pub type ErasStakers<T: Config> = StorageDoubleMap<
|
||||
_,
|
||||
Twox64Concat,
|
||||
@@ -544,7 +544,7 @@ pub mod pallet {
|
||||
///
|
||||
/// Is it removed after [`Config::HistoryDepth`] eras.
|
||||
/// If stakers hasn't been set or has been removed then empty overview is returned.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type ErasStakersOverview<T: Config> = StorageDoubleMap<
|
||||
_,
|
||||
Twox64Concat,
|
||||
@@ -571,8 +571,8 @@ pub mod pallet {
|
||||
/// If stakers hasn't been set or has been removed then empty exposure is returned.
|
||||
///
|
||||
/// Note: Deprecated since v14. Use `EraInfo` instead to work with exposures.
|
||||
#[pallet::storage]
|
||||
#[pallet::unbounded]
|
||||
#[pezpallet::storage]
|
||||
#[pezpallet::unbounded]
|
||||
pub type ErasStakersClipped<T: Config> = StorageDoubleMap<
|
||||
_,
|
||||
Twox64Concat,
|
||||
@@ -589,8 +589,8 @@ pub mod pallet {
|
||||
/// the page. Should only be accessed through `EraInfo`.
|
||||
///
|
||||
/// This is cleared after [`Config::HistoryDepth`] eras.
|
||||
#[pallet::storage]
|
||||
#[pallet::unbounded]
|
||||
#[pezpallet::storage]
|
||||
#[pezpallet::unbounded]
|
||||
pub type ErasStakersPaged<T: Config> = StorageNMap<
|
||||
_,
|
||||
(
|
||||
@@ -608,8 +608,8 @@ pub mod pallet {
|
||||
/// been claimed.
|
||||
///
|
||||
/// It is removed after [`Config::HistoryDepth`] eras.
|
||||
#[pallet::storage]
|
||||
#[pallet::unbounded]
|
||||
#[pezpallet::storage]
|
||||
#[pezpallet::unbounded]
|
||||
pub type ClaimedRewards<T: Config> = StorageDoubleMap<
|
||||
_,
|
||||
Twox64Concat,
|
||||
@@ -626,7 +626,7 @@ pub mod pallet {
|
||||
///
|
||||
/// Is it removed after [`Config::HistoryDepth`] eras.
|
||||
// If prefs hasn't been set or has been removed then 0 commission is returned.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type ErasValidatorPrefs<T: Config> = StorageDoubleMap<
|
||||
_,
|
||||
Twox64Concat,
|
||||
@@ -640,46 +640,46 @@ pub mod pallet {
|
||||
/// The total validator era payout for the last [`Config::HistoryDepth`] eras.
|
||||
///
|
||||
/// Eras that haven't finished yet or has been removed doesn't have reward.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type ErasValidatorReward<T: Config> = StorageMap<_, Twox64Concat, EraIndex, BalanceOf<T>>;
|
||||
|
||||
/// Rewards for the last [`Config::HistoryDepth`] eras.
|
||||
/// If reward hasn't been set or has been removed then 0 reward is returned.
|
||||
#[pallet::storage]
|
||||
#[pallet::unbounded]
|
||||
#[pezpallet::storage]
|
||||
#[pezpallet::unbounded]
|
||||
pub type ErasRewardPoints<T: Config> =
|
||||
StorageMap<_, Twox64Concat, EraIndex, EraRewardPoints<T::AccountId>, ValueQuery>;
|
||||
|
||||
/// The total amount staked for the last [`Config::HistoryDepth`] eras.
|
||||
/// If total hasn't been set or has been removed then 0 stake is returned.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type ErasTotalStake<T: Config> =
|
||||
StorageMap<_, Twox64Concat, EraIndex, BalanceOf<T>, ValueQuery>;
|
||||
|
||||
/// Mode of era forcing.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type ForceEra<T> = StorageValue<_, Forcing, ValueQuery>;
|
||||
|
||||
/// Maximum staked rewards, i.e. the percentage of the era inflation that
|
||||
/// is used for stake rewards.
|
||||
/// See [Era payout](./index.html#era-payout).
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type MaxStakedRewards<T> = StorageValue<_, Percent, OptionQuery>;
|
||||
|
||||
/// The percentage of the slash that is distributed to reporters.
|
||||
///
|
||||
/// The rest of the slashed value is handled by the `Slash`.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type SlashRewardFraction<T> = StorageValue<_, Perbill, ValueQuery>;
|
||||
|
||||
/// The amount of currency given to reporters of a slash event which was
|
||||
/// canceled by extraordinary circumstances (e.g. governance).
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type CanceledSlashPayout<T: Config> = StorageValue<_, BalanceOf<T>, ValueQuery>;
|
||||
|
||||
/// All unapplied slashes that are queued for later.
|
||||
#[pallet::storage]
|
||||
#[pallet::unbounded]
|
||||
#[pezpallet::storage]
|
||||
#[pezpallet::unbounded]
|
||||
pub type UnappliedSlashes<T: Config> = StorageMap<
|
||||
_,
|
||||
Twox64Concat,
|
||||
@@ -692,13 +692,13 @@ pub mod pallet {
|
||||
///
|
||||
/// Must contains information for eras for the range:
|
||||
/// `[active_era - bounding_duration; active_era]`
|
||||
#[pallet::storage]
|
||||
#[pallet::unbounded]
|
||||
#[pezpallet::storage]
|
||||
#[pezpallet::unbounded]
|
||||
pub type BondedEras<T: Config> = StorageValue<_, Vec<(EraIndex, SessionIndex)>, ValueQuery>;
|
||||
|
||||
/// All slashing events on validators, mapped by era to the highest slash proportion
|
||||
/// and slash value of the era.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type ValidatorSlashInEra<T: Config> = StorageDoubleMap<
|
||||
_,
|
||||
Twox64Concat,
|
||||
@@ -709,19 +709,19 @@ pub mod pallet {
|
||||
>;
|
||||
|
||||
/// All slashing events on nominators, mapped by era to the highest slash value of the era.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type NominatorSlashInEra<T: Config> =
|
||||
StorageDoubleMap<_, Twox64Concat, EraIndex, Twox64Concat, T::AccountId, BalanceOf<T>>;
|
||||
|
||||
/// Slashing spans for stash accounts.
|
||||
#[pallet::storage]
|
||||
#[pallet::unbounded]
|
||||
#[pezpallet::storage]
|
||||
#[pezpallet::unbounded]
|
||||
pub type SlashingSpans<T: Config> =
|
||||
StorageMap<_, Twox64Concat, T::AccountId, slashing::SlashingSpans>;
|
||||
|
||||
/// Records information about the maximum slash of a stash within a slashing span,
|
||||
/// as well as how much reward has been paid out.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type SpanSlash<T: Config> = StorageMap<
|
||||
_,
|
||||
Twox64Concat,
|
||||
@@ -730,19 +730,19 @@ pub mod pallet {
|
||||
ValueQuery,
|
||||
>;
|
||||
|
||||
/// The last planned session scheduled by the session pallet.
|
||||
/// The last planned session scheduled by the session pezpallet.
|
||||
///
|
||||
/// This is basically in sync with the call to [`pezpallet_session::SessionManager::new_session`].
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type CurrentPlannedSession<T> = StorageValue<_, SessionIndex, ValueQuery>;
|
||||
|
||||
/// The threshold for when users can start calling `chill_other` for other validators /
|
||||
/// nominators. The threshold is compared to the actual number of validators / nominators
|
||||
/// (`CountFor*`) in the system compared to the configured max (`Max*Count`).
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type ChillThreshold<T: Config> = StorageValue<_, Percent, OptionQuery>;
|
||||
|
||||
#[pallet::genesis_config]
|
||||
#[pezpallet::genesis_config]
|
||||
#[derive(pezframe_support::DefaultNoBound)]
|
||||
pub struct GenesisConfig<T: Config> {
|
||||
pub validator_count: u32,
|
||||
@@ -759,7 +759,7 @@ pub mod pallet {
|
||||
pub max_nominator_count: Option<u32>,
|
||||
}
|
||||
|
||||
#[pallet::genesis_build]
|
||||
#[pezpallet::genesis_build]
|
||||
impl<T: Config> BuildGenesisConfig for GenesisConfig<T> {
|
||||
fn build(&self) {
|
||||
ValidatorCount::<T>::put(self.validator_count);
|
||||
@@ -789,17 +789,17 @@ pub mod pallet {
|
||||
asset::free_to_stake::<T>(stash) >= balance,
|
||||
"Stash does not have enough balance to bond."
|
||||
);
|
||||
pezframe_support::assert_ok!(<Pallet<T>>::bond(
|
||||
pezframe_support::assert_ok!(<Pezpallet<T>>::bond(
|
||||
T::RuntimeOrigin::from(Some(stash.clone()).into()),
|
||||
balance,
|
||||
RewardDestination::Staked,
|
||||
));
|
||||
pezframe_support::assert_ok!(match status {
|
||||
crate::StakerStatus::Validator => <Pallet<T>>::validate(
|
||||
crate::StakerStatus::Validator => <Pezpallet<T>>::validate(
|
||||
T::RuntimeOrigin::from(Some(stash.clone()).into()),
|
||||
Default::default(),
|
||||
),
|
||||
crate::StakerStatus::Nominator(votes) => <Pallet<T>>::nominate(
|
||||
crate::StakerStatus::Nominator(votes) => <Pezpallet<T>>::nominate(
|
||||
T::RuntimeOrigin::from(Some(stash.clone()).into()),
|
||||
votes.iter().map(|l| T::Lookup::unlookup(l.clone())).collect(),
|
||||
),
|
||||
@@ -821,8 +821,8 @@ pub mod pallet {
|
||||
}
|
||||
}
|
||||
|
||||
#[pallet::event]
|
||||
#[pallet::generate_deposit(pub(crate) fn deposit_event)]
|
||||
#[pezpallet::event]
|
||||
#[pezpallet::generate_deposit(pub(crate) fn deposit_event)]
|
||||
pub enum Event<T: Config> {
|
||||
/// The era payout has been set; the first balance is the validator-payout; the second is
|
||||
/// the remainder from the maximum amount of reward.
|
||||
@@ -881,7 +881,7 @@ pub mod pallet {
|
||||
CurrencyMigrated { stash: T::AccountId, force_withdraw: BalanceOf<T> },
|
||||
}
|
||||
|
||||
#[pallet::error]
|
||||
#[pezpallet::error]
|
||||
#[derive(PartialEq)]
|
||||
pub enum Error<T> {
|
||||
/// Not a controller account.
|
||||
@@ -950,7 +950,7 @@ pub mod pallet {
|
||||
NotEnoughFunds,
|
||||
/// Operation not allowed for virtual stakers.
|
||||
VirtualStakerNotAllowed,
|
||||
/// Stash could not be reaped as other pallet might depend on it.
|
||||
/// Stash could not be reaped as other pezpallet might depend on it.
|
||||
CannotReapStash,
|
||||
/// The stake of this account is already migrated to `Fungible` holds.
|
||||
AlreadyMigrated,
|
||||
@@ -959,8 +959,8 @@ pub mod pallet {
|
||||
Restricted,
|
||||
}
|
||||
|
||||
#[pallet::hooks]
|
||||
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {
|
||||
#[pezpallet::hooks]
|
||||
impl<T: Config> Hooks<BlockNumberFor<T>> for Pezpallet<T> {
|
||||
fn on_initialize(_now: BlockNumberFor<T>) -> Weight {
|
||||
// just return the weight of the on_finalize.
|
||||
T::DbWeight::get().reads(1)
|
||||
@@ -1009,7 +1009,7 @@ pub mod pallet {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> Pallet<T> {
|
||||
impl<T: Config> Pezpallet<T> {
|
||||
/// Get the ideal number of active validators.
|
||||
pub fn validator_count() -> u32 {
|
||||
ValidatorCount::<T>::get()
|
||||
@@ -1153,14 +1153,14 @@ pub mod pallet {
|
||||
SlashingSpans::<T>::get(account_id)
|
||||
}
|
||||
|
||||
/// Get the last planned session scheduled by the session pallet.
|
||||
/// Get the last planned session scheduled by the session pezpallet.
|
||||
pub fn current_planned_session() -> SessionIndex {
|
||||
CurrentPlannedSession::<T>::get()
|
||||
}
|
||||
}
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pezpallet::call]
|
||||
impl<T: Config> Pezpallet<T> {
|
||||
/// Take the origin account as a stash and lock up `value` of its balance. `controller` will
|
||||
/// be the account that controls it.
|
||||
///
|
||||
@@ -1177,11 +1177,11 @@ pub mod pallet {
|
||||
/// NOTE: Two of the storage writes (`Self::bonded`, `Self::payee`) are _never_ cleaned
|
||||
/// unless the `origin` falls below _existential deposit_ (or equal to 0) and gets removed
|
||||
/// as dust.
|
||||
#[pallet::call_index(0)]
|
||||
#[pallet::weight(T::WeightInfo::bond())]
|
||||
#[pezpallet::call_index(0)]
|
||||
#[pezpallet::weight(T::WeightInfo::bond())]
|
||||
pub fn bond(
|
||||
origin: OriginFor<T>,
|
||||
#[pallet::compact] value: BalanceOf<T>,
|
||||
#[pezpallet::compact] value: BalanceOf<T>,
|
||||
payee: RewardDestination<T::AccountId>,
|
||||
) -> DispatchResult {
|
||||
let stash = ensure_signed(origin)?;
|
||||
@@ -1228,11 +1228,11 @@ pub mod pallet {
|
||||
/// ## Complexity
|
||||
/// - Independent of the arguments. Insignificant complexity.
|
||||
/// - O(1).
|
||||
#[pallet::call_index(1)]
|
||||
#[pallet::weight(T::WeightInfo::bond_extra())]
|
||||
#[pezpallet::call_index(1)]
|
||||
#[pezpallet::weight(T::WeightInfo::bond_extra())]
|
||||
pub fn bond_extra(
|
||||
origin: OriginFor<T>,
|
||||
#[pallet::compact] max_additional: BalanceOf<T>,
|
||||
#[pezpallet::compact] max_additional: BalanceOf<T>,
|
||||
) -> DispatchResult {
|
||||
let stash = ensure_signed(origin)?;
|
||||
ensure!(!T::Filter::contains(&stash), Error::<T>::Restricted);
|
||||
@@ -1260,13 +1260,13 @@ pub mod pallet {
|
||||
/// Emits `Unbonded`.
|
||||
///
|
||||
/// See also [`Call::withdraw_unbonded`].
|
||||
#[pallet::call_index(2)]
|
||||
#[pallet::weight(
|
||||
#[pezpallet::call_index(2)]
|
||||
#[pezpallet::weight(
|
||||
T::WeightInfo::withdraw_unbonded_kill(SPECULATIVE_NUM_SPANS).saturating_add(T::WeightInfo::unbond()).saturating_add(T::WeightInfo::chill()))
|
||||
]
|
||||
pub fn unbond(
|
||||
origin: OriginFor<T>,
|
||||
#[pallet::compact] value: BalanceOf<T>,
|
||||
#[pezpallet::compact] value: BalanceOf<T>,
|
||||
) -> DispatchResultWithPostInfo {
|
||||
let controller = ensure_signed(origin)?;
|
||||
|
||||
@@ -1309,8 +1309,8 @@ pub mod pallet {
|
||||
/// ## Complexity
|
||||
/// O(S) where S is the number of slashing spans to remove
|
||||
/// NOTE: Weight annotation is the kill scenario, we refund otherwise.
|
||||
#[pallet::call_index(3)]
|
||||
#[pallet::weight(T::WeightInfo::withdraw_unbonded_kill(*num_slashing_spans))]
|
||||
#[pezpallet::call_index(3)]
|
||||
#[pezpallet::weight(T::WeightInfo::withdraw_unbonded_kill(*num_slashing_spans))]
|
||||
pub fn withdraw_unbonded(
|
||||
origin: OriginFor<T>,
|
||||
num_slashing_spans: u32,
|
||||
@@ -1326,8 +1326,8 @@ pub mod pallet {
|
||||
/// Effects will be felt at the beginning of the next era.
|
||||
///
|
||||
/// The dispatch origin for this call must be _Signed_ by the controller, not the stash.
|
||||
#[pallet::call_index(4)]
|
||||
#[pallet::weight(T::WeightInfo::validate())]
|
||||
#[pezpallet::call_index(4)]
|
||||
#[pezpallet::weight(T::WeightInfo::validate())]
|
||||
pub fn validate(origin: OriginFor<T>, prefs: ValidatorPrefs) -> DispatchResult {
|
||||
let controller = ensure_signed(origin)?;
|
||||
|
||||
@@ -1369,8 +1369,8 @@ pub mod pallet {
|
||||
/// - The transaction's complexity is proportional to the size of `targets` (N)
|
||||
/// which is capped at CompactAssignments::LIMIT (T::MaxNominations).
|
||||
/// - Both the reads and writes follow a similar pattern.
|
||||
#[pallet::call_index(5)]
|
||||
#[pallet::weight(T::WeightInfo::nominate(targets.len() as u32))]
|
||||
#[pezpallet::call_index(5)]
|
||||
#[pezpallet::weight(T::WeightInfo::nominate(targets.len() as u32))]
|
||||
pub fn nominate(
|
||||
origin: OriginFor<T>,
|
||||
targets: Vec<AccountIdLookupOf<T>>,
|
||||
@@ -1441,8 +1441,8 @@ pub mod pallet {
|
||||
/// - Independent of the arguments. Insignificant complexity.
|
||||
/// - Contains one read.
|
||||
/// - Writes are limited to the `origin` account key.
|
||||
#[pallet::call_index(6)]
|
||||
#[pallet::weight(T::WeightInfo::chill())]
|
||||
#[pezpallet::call_index(6)]
|
||||
#[pezpallet::weight(T::WeightInfo::chill())]
|
||||
pub fn chill(origin: OriginFor<T>) -> DispatchResult {
|
||||
let controller = ensure_signed(origin)?;
|
||||
|
||||
@@ -1464,8 +1464,8 @@ pub mod pallet {
|
||||
/// - Contains a limited number of reads.
|
||||
/// - Writes are limited to the `origin` account key.
|
||||
/// ---------
|
||||
#[pallet::call_index(7)]
|
||||
#[pallet::weight(T::WeightInfo::set_payee())]
|
||||
#[pezpallet::call_index(7)]
|
||||
#[pezpallet::weight(T::WeightInfo::set_payee())]
|
||||
pub fn set_payee(
|
||||
origin: OriginFor<T>,
|
||||
payee: RewardDestination<T::AccountId>,
|
||||
@@ -1502,8 +1502,8 @@ pub mod pallet {
|
||||
/// - Independent of the arguments. Insignificant complexity.
|
||||
/// - Contains a limited number of reads.
|
||||
/// - Writes are limited to the `origin` account key.
|
||||
#[pallet::call_index(8)]
|
||||
#[pallet::weight(T::WeightInfo::set_controller())]
|
||||
#[pezpallet::call_index(8)]
|
||||
#[pezpallet::weight(T::WeightInfo::set_controller())]
|
||||
pub fn set_controller(origin: OriginFor<T>) -> DispatchResult {
|
||||
let stash = ensure_signed(origin)?;
|
||||
|
||||
@@ -1528,11 +1528,11 @@ pub mod pallet {
|
||||
///
|
||||
/// ## Complexity
|
||||
/// O(1)
|
||||
#[pallet::call_index(9)]
|
||||
#[pallet::weight(T::WeightInfo::set_validator_count())]
|
||||
#[pezpallet::call_index(9)]
|
||||
#[pezpallet::weight(T::WeightInfo::set_validator_count())]
|
||||
pub fn set_validator_count(
|
||||
origin: OriginFor<T>,
|
||||
#[pallet::compact] new: u32,
|
||||
#[pezpallet::compact] new: u32,
|
||||
) -> DispatchResult {
|
||||
ensure_root(origin)?;
|
||||
// ensure new validator count does not exceed maximum winners
|
||||
@@ -1550,11 +1550,11 @@ pub mod pallet {
|
||||
///
|
||||
/// ## Complexity
|
||||
/// Same as [`Self::set_validator_count`].
|
||||
#[pallet::call_index(10)]
|
||||
#[pallet::weight(T::WeightInfo::set_validator_count())]
|
||||
#[pezpallet::call_index(10)]
|
||||
#[pezpallet::weight(T::WeightInfo::set_validator_count())]
|
||||
pub fn increase_validator_count(
|
||||
origin: OriginFor<T>,
|
||||
#[pallet::compact] additional: u32,
|
||||
#[pezpallet::compact] additional: u32,
|
||||
) -> DispatchResult {
|
||||
ensure_root(origin)?;
|
||||
let old = ValidatorCount::<T>::get();
|
||||
@@ -1572,8 +1572,8 @@ pub mod pallet {
|
||||
///
|
||||
/// ## Complexity
|
||||
/// Same as [`Self::set_validator_count`].
|
||||
#[pallet::call_index(11)]
|
||||
#[pallet::weight(T::WeightInfo::set_validator_count())]
|
||||
#[pezpallet::call_index(11)]
|
||||
#[pezpallet::weight(T::WeightInfo::set_validator_count())]
|
||||
pub fn scale_validator_count(origin: OriginFor<T>, factor: Percent) -> DispatchResult {
|
||||
ensure_root(origin)?;
|
||||
let old = ValidatorCount::<T>::get();
|
||||
@@ -1598,8 +1598,8 @@ pub mod pallet {
|
||||
/// ## Complexity
|
||||
/// - No arguments.
|
||||
/// - Weight: O(1)
|
||||
#[pallet::call_index(12)]
|
||||
#[pallet::weight(T::WeightInfo::force_no_eras())]
|
||||
#[pezpallet::call_index(12)]
|
||||
#[pezpallet::weight(T::WeightInfo::force_no_eras())]
|
||||
pub fn force_no_eras(origin: OriginFor<T>) -> DispatchResult {
|
||||
ensure_root(origin)?;
|
||||
Self::set_force_era(Forcing::ForceNone);
|
||||
@@ -1620,8 +1620,8 @@ pub mod pallet {
|
||||
/// ## Complexity
|
||||
/// - No arguments.
|
||||
/// - Weight: O(1)
|
||||
#[pallet::call_index(13)]
|
||||
#[pallet::weight(T::WeightInfo::force_new_era())]
|
||||
#[pezpallet::call_index(13)]
|
||||
#[pezpallet::weight(T::WeightInfo::force_new_era())]
|
||||
pub fn force_new_era(origin: OriginFor<T>) -> DispatchResult {
|
||||
ensure_root(origin)?;
|
||||
Self::set_force_era(Forcing::ForceNew);
|
||||
@@ -1631,8 +1631,8 @@ pub mod pallet {
|
||||
/// Set the validators who cannot be slashed (if any).
|
||||
///
|
||||
/// The dispatch origin must be Root.
|
||||
#[pallet::call_index(14)]
|
||||
#[pallet::weight(T::WeightInfo::set_invulnerables(invulnerables.len() as u32))]
|
||||
#[pezpallet::call_index(14)]
|
||||
#[pezpallet::weight(T::WeightInfo::set_invulnerables(invulnerables.len() as u32))]
|
||||
pub fn set_invulnerables(
|
||||
origin: OriginFor<T>,
|
||||
invulnerables: Vec<T::AccountId>,
|
||||
@@ -1650,8 +1650,8 @@ pub mod pallet {
|
||||
///
|
||||
/// - `num_slashing_spans`: Refer to comments on [`Call::withdraw_unbonded`] for more
|
||||
/// details.
|
||||
#[pallet::call_index(15)]
|
||||
#[pallet::weight(T::WeightInfo::force_unstake(*num_slashing_spans))]
|
||||
#[pezpallet::call_index(15)]
|
||||
#[pezpallet::weight(T::WeightInfo::force_unstake(*num_slashing_spans))]
|
||||
pub fn force_unstake(
|
||||
origin: OriginFor<T>,
|
||||
stash: T::AccountId,
|
||||
@@ -1674,8 +1674,8 @@ pub mod pallet {
|
||||
/// The election process starts multiple blocks before the end of the era.
|
||||
/// If this is called just before a new era is triggered, the election process may not
|
||||
/// have enough blocks to get a result.
|
||||
#[pallet::call_index(16)]
|
||||
#[pallet::weight(T::WeightInfo::force_new_era_always())]
|
||||
#[pezpallet::call_index(16)]
|
||||
#[pezpallet::weight(T::WeightInfo::force_new_era_always())]
|
||||
pub fn force_new_era_always(origin: OriginFor<T>) -> DispatchResult {
|
||||
ensure_root(origin)?;
|
||||
Self::set_force_era(Forcing::ForceAlways);
|
||||
@@ -1688,8 +1688,8 @@ pub mod pallet {
|
||||
///
|
||||
/// Parameters: era and indices of the slashes for that era to kill.
|
||||
/// They **must** be sorted in ascending order, *and* unique.
|
||||
#[pallet::call_index(17)]
|
||||
#[pallet::weight(T::WeightInfo::cancel_deferred_slash(slash_indices.len() as u32))]
|
||||
#[pezpallet::call_index(17)]
|
||||
#[pezpallet::weight(T::WeightInfo::cancel_deferred_slash(slash_indices.len() as u32))]
|
||||
pub fn cancel_deferred_slash(
|
||||
origin: OriginFor<T>,
|
||||
era: EraIndex,
|
||||
@@ -1726,8 +1726,8 @@ pub mod pallet {
|
||||
/// specific page, use `payout_stakers_by_page`.`
|
||||
///
|
||||
/// If all pages are claimed, it returns an error `InvalidPage`.
|
||||
#[pallet::call_index(18)]
|
||||
#[pallet::weight(T::WeightInfo::payout_stakers_alive_staked(T::MaxExposurePageSize::get()))]
|
||||
#[pezpallet::call_index(18)]
|
||||
#[pezpallet::weight(T::WeightInfo::payout_stakers_alive_staked(T::MaxExposurePageSize::get()))]
|
||||
pub fn payout_stakers(
|
||||
origin: OriginFor<T>,
|
||||
validator_stash: T::AccountId,
|
||||
@@ -1744,11 +1744,11 @@ pub mod pallet {
|
||||
/// ## Complexity
|
||||
/// - Time complexity: O(L), where L is unlocking chunks
|
||||
/// - Bounded by `MaxUnlockingChunks`.
|
||||
#[pallet::call_index(19)]
|
||||
#[pallet::weight(T::WeightInfo::rebond(T::MaxUnlockingChunks::get() as u32))]
|
||||
#[pezpallet::call_index(19)]
|
||||
#[pezpallet::weight(T::WeightInfo::rebond(T::MaxUnlockingChunks::get() as u32))]
|
||||
pub fn rebond(
|
||||
origin: OriginFor<T>,
|
||||
#[pallet::compact] value: BalanceOf<T>,
|
||||
#[pezpallet::compact] value: BalanceOf<T>,
|
||||
) -> DispatchResultWithPostInfo {
|
||||
let controller = ensure_signed(origin)?;
|
||||
let ledger = Self::ledger(Controller(controller))?;
|
||||
@@ -1802,8 +1802,8 @@ pub mod pallet {
|
||||
///
|
||||
/// - `num_slashing_spans`: Refer to comments on [`Call::withdraw_unbonded`] for more
|
||||
/// details.
|
||||
#[pallet::call_index(20)]
|
||||
#[pallet::weight(T::WeightInfo::reap_stash(*num_slashing_spans))]
|
||||
#[pezpallet::call_index(20)]
|
||||
#[pezpallet::weight(T::WeightInfo::reap_stash(*num_slashing_spans))]
|
||||
pub fn reap_stash(
|
||||
origin: OriginFor<T>,
|
||||
stash: T::AccountId,
|
||||
@@ -1841,8 +1841,8 @@ pub mod pallet {
|
||||
///
|
||||
/// Note: Making this call only makes sense if you first set the validator preferences to
|
||||
/// block any further nominations.
|
||||
#[pallet::call_index(21)]
|
||||
#[pallet::weight(T::WeightInfo::kick(who.len() as u32))]
|
||||
#[pezpallet::call_index(21)]
|
||||
#[pezpallet::weight(T::WeightInfo::kick(who.len() as u32))]
|
||||
pub fn kick(origin: OriginFor<T>, who: Vec<AccountIdLookupOf<T>>) -> DispatchResult {
|
||||
let controller = ensure_signed(origin)?;
|
||||
let ledger = Self::ledger(Controller(controller))?;
|
||||
@@ -1889,8 +1889,8 @@ pub mod pallet {
|
||||
/// to kick people under the new limits, `chill_other` should be called.
|
||||
// We assume the worst case for this call is either: all items are set or all items are
|
||||
// removed.
|
||||
#[pallet::call_index(22)]
|
||||
#[pallet::weight(
|
||||
#[pezpallet::call_index(22)]
|
||||
#[pezpallet::weight(
|
||||
T::WeightInfo::set_staking_configs_all_set()
|
||||
.max(T::WeightInfo::set_staking_configs_all_remove())
|
||||
)]
|
||||
@@ -1951,8 +1951,8 @@ pub mod pallet {
|
||||
///
|
||||
/// This can be helpful if bond requirements are updated, and we need to remove old users
|
||||
/// who do not satisfy these requirements.
|
||||
#[pallet::call_index(23)]
|
||||
#[pallet::weight(T::WeightInfo::chill_other())]
|
||||
#[pezpallet::call_index(23)]
|
||||
#[pezpallet::weight(T::WeightInfo::chill_other())]
|
||||
pub fn chill_other(origin: OriginFor<T>, stash: T::AccountId) -> DispatchResult {
|
||||
// Anyone can call this function.
|
||||
let caller = ensure_signed(origin)?;
|
||||
@@ -2019,8 +2019,8 @@ pub mod pallet {
|
||||
/// Force a validator to have at least the minimum commission. This will not affect a
|
||||
/// validator who already has a commission greater than or equal to the minimum. Any account
|
||||
/// can call this.
|
||||
#[pallet::call_index(24)]
|
||||
#[pallet::weight(T::WeightInfo::force_apply_min_commission())]
|
||||
#[pezpallet::call_index(24)]
|
||||
#[pezpallet::weight(T::WeightInfo::force_apply_min_commission())]
|
||||
pub fn force_apply_min_commission(
|
||||
origin: OriginFor<T>,
|
||||
validator_stash: T::AccountId,
|
||||
@@ -2043,8 +2043,8 @@ pub mod pallet {
|
||||
///
|
||||
/// This call has lower privilege requirements than `set_staking_config` and can be called
|
||||
/// by the `T::AdminOrigin`. Root can always call this.
|
||||
#[pallet::call_index(25)]
|
||||
#[pallet::weight(T::WeightInfo::set_min_commission())]
|
||||
#[pezpallet::call_index(25)]
|
||||
#[pezpallet::weight(T::WeightInfo::set_min_commission())]
|
||||
pub fn set_min_commission(origin: OriginFor<T>, new: Perbill) -> DispatchResult {
|
||||
T::AdminOrigin::ensure_origin(origin)?;
|
||||
MinCommission::<T>::put(new);
|
||||
@@ -2068,8 +2068,8 @@ pub mod pallet {
|
||||
/// backing a validator to receive the reward. The nominators are not sorted across pages
|
||||
/// and so it should not be assumed the highest staker would be on the topmost page and vice
|
||||
/// versa. If rewards are not claimed in [`Config::HistoryDepth`] eras, they are lost.
|
||||
#[pallet::call_index(26)]
|
||||
#[pallet::weight(T::WeightInfo::payout_stakers_alive_staked(T::MaxExposurePageSize::get()))]
|
||||
#[pezpallet::call_index(26)]
|
||||
#[pezpallet::weight(T::WeightInfo::payout_stakers_alive_staked(T::MaxExposurePageSize::get()))]
|
||||
pub fn payout_stakers_by_page(
|
||||
origin: OriginFor<T>,
|
||||
validator_stash: T::AccountId,
|
||||
@@ -2086,8 +2086,8 @@ pub mod pallet {
|
||||
/// Effects will be felt instantly (as soon as this function is completed successfully).
|
||||
///
|
||||
/// This will waive the transaction fee if the `payee` is successfully migrated.
|
||||
#[pallet::call_index(27)]
|
||||
#[pallet::weight(T::WeightInfo::update_payee())]
|
||||
#[pezpallet::call_index(27)]
|
||||
#[pezpallet::weight(T::WeightInfo::update_payee())]
|
||||
pub fn update_payee(
|
||||
origin: OriginFor<T>,
|
||||
controller: T::AccountId,
|
||||
@@ -2117,8 +2117,8 @@ pub mod pallet {
|
||||
/// Effects will be felt instantly (as soon as this function is completed successfully).
|
||||
///
|
||||
/// The dispatch origin must be `T::AdminOrigin`.
|
||||
#[pallet::call_index(28)]
|
||||
#[pallet::weight(T::WeightInfo::deprecate_controller_batch(controllers.len() as u32))]
|
||||
#[pezpallet::call_index(28)]
|
||||
#[pezpallet::weight(T::WeightInfo::deprecate_controller_batch(controllers.len() as u32))]
|
||||
pub fn deprecate_controller_batch(
|
||||
origin: OriginFor<T>,
|
||||
controllers: BoundedVec<T::AccountId, T::MaxControllersInDeprecationBatch>,
|
||||
@@ -2168,8 +2168,8 @@ pub mod pallet {
|
||||
/// The `maybe_*` input parameters will overwrite the corresponding data and metadata of the
|
||||
/// ledger associated with the stash. If the input parameters are not set, the ledger will
|
||||
/// be reset values from on-chain state.
|
||||
#[pallet::call_index(29)]
|
||||
#[pallet::weight(T::WeightInfo::restore_ledger())]
|
||||
#[pezpallet::call_index(29)]
|
||||
#[pezpallet::weight(T::WeightInfo::restore_ledger())]
|
||||
pub fn restore_ledger(
|
||||
origin: OriginFor<T>,
|
||||
stash: T::AccountId,
|
||||
@@ -2259,8 +2259,8 @@ pub mod pallet {
|
||||
/// much as possible. The remaining stake is forced withdrawn from the ledger.
|
||||
///
|
||||
/// The fee is waived if the migration is successful.
|
||||
#[pallet::call_index(30)]
|
||||
#[pallet::weight(T::WeightInfo::migrate_currency())]
|
||||
#[pezpallet::call_index(30)]
|
||||
#[pezpallet::weight(T::WeightInfo::migrate_currency())]
|
||||
pub fn migrate_currency(
|
||||
origin: OriginFor<T>,
|
||||
stash: T::AccountId,
|
||||
@@ -2293,8 +2293,8 @@ pub mod pallet {
|
||||
/// - If the validator was previously slashed by a lower percentage, only the difference
|
||||
/// will be applied.
|
||||
/// - The slash will be deferred by `SlashDeferDuration` eras before being enacted.
|
||||
#[pallet::call_index(33)]
|
||||
#[pallet::weight(T::WeightInfo::manual_slash())]
|
||||
#[pezpallet::call_index(33)]
|
||||
#[pezpallet::weight(T::WeightInfo::manual_slash())]
|
||||
pub fn manual_slash(
|
||||
origin: OriginFor<T>,
|
||||
validator_stash: T::AccountId,
|
||||
@@ -50,7 +50,7 @@
|
||||
//! Based on research at <https://research.web3.foundation/en/latest/polkadot/slashing/npos.html>
|
||||
|
||||
use crate::{
|
||||
asset, BalanceOf, Config, Error, Exposure, NegativeImbalanceOf, NominatorSlashInEra, Pallet,
|
||||
asset, BalanceOf, Config, Error, Exposure, NegativeImbalanceOf, NominatorSlashInEra, Pezpallet,
|
||||
Perbill, SpanSlash, UnappliedSlash, ValidatorSlashInEra,
|
||||
};
|
||||
use alloc::vec::Vec;
|
||||
@@ -559,7 +559,7 @@ pub fn do_slash<T: Config>(
|
||||
slash_era: EraIndex,
|
||||
) {
|
||||
let mut ledger =
|
||||
match Pallet::<T>::ledger(pezsp_staking::StakingAccount::Stash(stash.clone())).defensive() {
|
||||
match Pezpallet::<T>::ledger(pezsp_staking::StakingAccount::Stash(stash.clone())).defensive() {
|
||||
Ok(ledger) => ledger,
|
||||
Err(_) => return, // nothing to do.
|
||||
};
|
||||
@@ -571,7 +571,7 @@ pub fn do_slash<T: Config>(
|
||||
}
|
||||
|
||||
// Skip slashing for virtual stakers. The pallets managing them should handle the slashing.
|
||||
if !Pallet::<T>::is_virtual_staker(stash) {
|
||||
if !Pezpallet::<T>::is_virtual_staker(stash) {
|
||||
let (imbalance, missing) = asset::slash::<T>(stash, value);
|
||||
slashed_imbalance.subsume(imbalance);
|
||||
|
||||
@@ -586,7 +586,7 @@ pub fn do_slash<T: Config>(
|
||||
.defensive_proof("ledger fetched from storage so it exists in storage; qed.");
|
||||
|
||||
// trigger the event
|
||||
<Pallet<T>>::deposit_event(super::Event::<T>::Slashed { staker: stash.clone(), amount: value });
|
||||
<Pezpallet<T>>::deposit_event(super::Event::<T>::Slashed { staker: stash.clone(), amount: value });
|
||||
}
|
||||
|
||||
/// Apply a previously-unapplied slash.
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
//! Testing utils for staking. Provides some common functions to setup staking state, such as
|
||||
//! bonding validators, nominators, and generating different types of solutions.
|
||||
|
||||
use crate::{Pallet as Staking, *};
|
||||
use crate::{Pezpallet as Staking, *};
|
||||
use pezframe_benchmarking::account;
|
||||
use pezframe_system::RawOrigin;
|
||||
use rand_chacha::{
|
||||
@@ -254,5 +254,5 @@ pub fn migrate_to_old_currency<T: Config>(who: T::AccountId) {
|
||||
asset::kill_stake::<T>(&who).expect("remove hold failed");
|
||||
|
||||
// replicate old behaviour of explicit increment of consumer.
|
||||
pezframe_system::Pallet::<T>::inc_consumers(&who).expect("increment consumer failed");
|
||||
pezframe_system::Pezpallet::<T>::inc_consumers(&who).expect("increment consumer failed");
|
||||
}
|
||||
|
||||
@@ -323,10 +323,10 @@ fn rewards_should_work() {
|
||||
Payee::<Test>::insert(21, RewardDestination::Account(21));
|
||||
Payee::<Test>::insert(101, RewardDestination::Account(101));
|
||||
|
||||
Pallet::<Test>::reward_by_ids(vec![(11, 50)]);
|
||||
Pallet::<Test>::reward_by_ids(vec![(11, 50)]);
|
||||
Pezpallet::<Test>::reward_by_ids(vec![(11, 50)]);
|
||||
Pezpallet::<Test>::reward_by_ids(vec![(11, 50)]);
|
||||
// This is the second validator of the current elected set.
|
||||
Pallet::<Test>::reward_by_ids(vec![(21, 50)]);
|
||||
Pezpallet::<Test>::reward_by_ids(vec![(21, 50)]);
|
||||
|
||||
// Compute total payout now for whole duration of the session.
|
||||
let total_payout_0 = current_total_payout_for_duration(reward_time_per_era());
|
||||
@@ -392,7 +392,7 @@ fn rewards_should_work() {
|
||||
);
|
||||
|
||||
assert_eq_uvec!(Session::validators(), vec![11, 21]);
|
||||
Pallet::<Test>::reward_by_ids(vec![(11, 1)]);
|
||||
Pezpallet::<Test>::reward_by_ids(vec![(11, 1)]);
|
||||
|
||||
// Compute total payout now for whole duration as other parameter won't change
|
||||
let total_payout_1 = current_total_payout_for_duration(reward_time_per_era());
|
||||
@@ -639,8 +639,8 @@ fn nominating_and_rewards_should_work() {
|
||||
|
||||
// the total reward for era 0
|
||||
let total_payout_0 = current_total_payout_for_duration(reward_time_per_era());
|
||||
Pallet::<Test>::reward_by_ids(vec![(41, 1)]);
|
||||
Pallet::<Test>::reward_by_ids(vec![(21, 1)]);
|
||||
Pezpallet::<Test>::reward_by_ids(vec![(41, 1)]);
|
||||
Pezpallet::<Test>::reward_by_ids(vec![(21, 1)]);
|
||||
|
||||
mock::start_active_era(1);
|
||||
|
||||
@@ -681,8 +681,8 @@ fn nominating_and_rewards_should_work() {
|
||||
|
||||
// the total reward for era 1
|
||||
let total_payout_1 = current_total_payout_for_duration(reward_time_per_era());
|
||||
Pallet::<Test>::reward_by_ids(vec![(21, 2)]);
|
||||
Pallet::<Test>::reward_by_ids(vec![(11, 1)]);
|
||||
Pezpallet::<Test>::reward_by_ids(vec![(21, 2)]);
|
||||
Pezpallet::<Test>::reward_by_ids(vec![(11, 1)]);
|
||||
|
||||
mock::start_active_era(2);
|
||||
|
||||
@@ -1126,7 +1126,7 @@ fn reward_destination_works() {
|
||||
|
||||
// Compute total payout now for whole duration as other parameter won't change
|
||||
let total_payout_0 = current_total_payout_for_duration(reward_time_per_era());
|
||||
Pallet::<Test>::reward_by_ids(vec![(11, 1)]);
|
||||
Pezpallet::<Test>::reward_by_ids(vec![(11, 1)]);
|
||||
|
||||
mock::start_active_era(1);
|
||||
mock::make_all_reward_payment(0);
|
||||
@@ -1155,7 +1155,7 @@ fn reward_destination_works() {
|
||||
|
||||
// Compute total payout now for whole duration as other parameter won't change
|
||||
let total_payout_1 = current_total_payout_for_duration(reward_time_per_era());
|
||||
Pallet::<Test>::reward_by_ids(vec![(11, 1)]);
|
||||
Pezpallet::<Test>::reward_by_ids(vec![(11, 1)]);
|
||||
|
||||
mock::start_active_era(2);
|
||||
mock::make_all_reward_payment(1);
|
||||
@@ -1189,7 +1189,7 @@ fn reward_destination_works() {
|
||||
|
||||
// Compute total payout now for whole duration as other parameter won't change
|
||||
let total_payout_2 = current_total_payout_for_duration(reward_time_per_era());
|
||||
Pallet::<Test>::reward_by_ids(vec![(11, 1)]);
|
||||
Pezpallet::<Test>::reward_by_ids(vec![(11, 1)]);
|
||||
|
||||
mock::start_active_era(3);
|
||||
mock::make_all_reward_payment(2);
|
||||
@@ -1237,7 +1237,7 @@ fn validator_payment_prefs_work() {
|
||||
// Compute total payout now for whole duration as other parameter won't change
|
||||
let total_payout_1 = current_total_payout_for_duration(reward_time_per_era());
|
||||
let exposure_1 = Staking::eras_stakers(active_era(), &11);
|
||||
Pallet::<Test>::reward_by_ids(vec![(11, 1)]);
|
||||
Pezpallet::<Test>::reward_by_ids(vec![(11, 1)]);
|
||||
|
||||
mock::start_active_era(2);
|
||||
mock::make_all_reward_payment(1);
|
||||
@@ -1930,8 +1930,8 @@ fn reward_to_stake_works() {
|
||||
|
||||
// Compute total payout now for whole duration as other parameter won't change
|
||||
let total_payout_0 = current_total_payout_for_duration(reward_time_per_era());
|
||||
Pallet::<Test>::reward_by_ids(vec![(11, 1)]);
|
||||
Pallet::<Test>::reward_by_ids(vec![(21, 1)]);
|
||||
Pezpallet::<Test>::reward_by_ids(vec![(11, 1)]);
|
||||
Pezpallet::<Test>::reward_by_ids(vec![(21, 1)]);
|
||||
|
||||
// New era --> rewards are paid --> stakes are changed
|
||||
mock::start_active_era(1);
|
||||
@@ -2430,10 +2430,10 @@ fn reward_from_authorship_event_handler_works() {
|
||||
ExtBuilder::default().build_and_execute(|| {
|
||||
use pezpallet_authorship::EventHandler;
|
||||
|
||||
assert_eq!(<pezpallet_authorship::Pallet<Test>>::author(), Some(11));
|
||||
assert_eq!(<pezpallet_authorship::Pezpallet<Test>>::author(), Some(11));
|
||||
|
||||
Pallet::<Test>::note_author(11);
|
||||
Pallet::<Test>::note_author(11);
|
||||
Pezpallet::<Test>::note_author(11);
|
||||
Pezpallet::<Test>::note_author(11);
|
||||
|
||||
// Not mandatory but must be coherent with rewards
|
||||
assert_eq_uvec!(Session::validators(), vec![11, 21]);
|
||||
@@ -2453,9 +2453,9 @@ fn add_reward_points_fns_works() {
|
||||
// Not mandatory but must be coherent with rewards
|
||||
assert_eq_uvec!(Session::validators(), vec![21, 11]);
|
||||
|
||||
Pallet::<Test>::reward_by_ids(vec![(21, 1), (11, 1), (11, 1)]);
|
||||
Pezpallet::<Test>::reward_by_ids(vec![(21, 1), (11, 1), (11, 1)]);
|
||||
|
||||
Pallet::<Test>::reward_by_ids(vec![(21, 1), (11, 1), (11, 1)]);
|
||||
Pezpallet::<Test>::reward_by_ids(vec![(21, 1), (11, 1), (11, 1)]);
|
||||
|
||||
assert_eq!(
|
||||
ErasRewardPoints::<Test>::get(active_era()),
|
||||
@@ -3179,13 +3179,13 @@ fn claim_reward_at_the_last_era_and_no_double_claim_and_invalid_claim() {
|
||||
Payee::<Test>::insert(11, RewardDestination::Account(11));
|
||||
Payee::<Test>::insert(101, RewardDestination::Account(101));
|
||||
|
||||
Pallet::<Test>::reward_by_ids(vec![(11, 1)]);
|
||||
Pezpallet::<Test>::reward_by_ids(vec![(11, 1)]);
|
||||
// Compute total payout now for whole duration as other parameter won't change
|
||||
let total_payout_0 = current_total_payout_for_duration(reward_time_per_era());
|
||||
|
||||
mock::start_active_era(1);
|
||||
|
||||
Pallet::<Test>::reward_by_ids(vec![(11, 1)]);
|
||||
Pezpallet::<Test>::reward_by_ids(vec![(11, 1)]);
|
||||
// Increase total token issuance to affect the total payout.
|
||||
let _ = Balances::deposit_creating(&999, 1_000_000_000);
|
||||
|
||||
@@ -3195,7 +3195,7 @@ fn claim_reward_at_the_last_era_and_no_double_claim_and_invalid_claim() {
|
||||
|
||||
mock::start_active_era(2);
|
||||
|
||||
Pallet::<Test>::reward_by_ids(vec![(11, 1)]);
|
||||
Pezpallet::<Test>::reward_by_ids(vec![(11, 1)]);
|
||||
// Increase total token issuance to affect the total payout.
|
||||
let _ = Balances::deposit_creating(&999, 1_000_000_000);
|
||||
// Compute total payout now for whole duration as other parameter won't change
|
||||
@@ -3347,7 +3347,7 @@ fn test_nominators_over_max_exposure_page_size_are_rewarded() {
|
||||
}
|
||||
mock::start_active_era(1);
|
||||
|
||||
Pallet::<Test>::reward_by_ids(vec![(11, 1)]);
|
||||
Pezpallet::<Test>::reward_by_ids(vec![(11, 1)]);
|
||||
// compute and ensure the reward amount is greater than zero.
|
||||
let _ = current_total_payout_for_duration(reward_time_per_era());
|
||||
|
||||
@@ -3388,7 +3388,7 @@ fn test_nominators_are_rewarded_for_all_exposure_page() {
|
||||
}
|
||||
mock::start_active_era(1);
|
||||
|
||||
Pallet::<Test>::reward_by_ids(vec![(11, 1)]);
|
||||
Pezpallet::<Test>::reward_by_ids(vec![(11, 1)]);
|
||||
// compute and ensure the reward amount is greater than zero.
|
||||
let _ = current_total_payout_for_duration(reward_time_per_era());
|
||||
|
||||
@@ -6377,7 +6377,7 @@ fn can_page_exposure() {
|
||||
fn should_retain_era_info_only_upto_history_depth() {
|
||||
ExtBuilder::default().build_and_execute(|| {
|
||||
// remove existing exposure
|
||||
Pallet::<Test>::clear_era_information(0);
|
||||
Pezpallet::<Test>::clear_era_information(0);
|
||||
let validator_stash = 10;
|
||||
|
||||
for era in 0..4 {
|
||||
@@ -6399,7 +6399,7 @@ fn should_retain_era_info_only_upto_history_depth() {
|
||||
assert_eq!(ErasStakersPaged::<Test>::iter_prefix((i as EraIndex,)).count(), 3);
|
||||
|
||||
// when clear era info
|
||||
Pallet::<Test>::clear_era_information(i as EraIndex);
|
||||
Pezpallet::<Test>::clear_era_information(i as EraIndex);
|
||||
|
||||
// then all era entries are cleared
|
||||
assert_eq!(ClaimedRewards::<Test>::iter_prefix(i as EraIndex).count(), 0);
|
||||
@@ -6416,9 +6416,9 @@ fn test_legacy_claimed_rewards_is_checked_at_reward_payout() {
|
||||
|
||||
// reward validator for next 2 eras
|
||||
mock::start_active_era(1);
|
||||
Pallet::<Test>::reward_by_ids(vec![(11, 1)]);
|
||||
Pezpallet::<Test>::reward_by_ids(vec![(11, 1)]);
|
||||
mock::start_active_era(2);
|
||||
Pallet::<Test>::reward_by_ids(vec![(11, 1)]);
|
||||
Pezpallet::<Test>::reward_by_ids(vec![(11, 1)]);
|
||||
mock::start_active_era(3);
|
||||
|
||||
//verify rewards are not claimed
|
||||
@@ -6524,7 +6524,7 @@ fn test_validator_exposure_is_backward_compatible_with_non_paged_rewards_payout(
|
||||
|
||||
mock::start_active_era(1);
|
||||
// reward validator for current era
|
||||
Pallet::<Test>::reward_by_ids(vec![(11, 1)]);
|
||||
Pezpallet::<Test>::reward_by_ids(vec![(11, 1)]);
|
||||
|
||||
// start new era
|
||||
mock::start_active_era(2);
|
||||
@@ -7005,7 +7005,7 @@ mod staking_unchecked {
|
||||
assert_eq!(asset::staked::<Test>(&200), 0);
|
||||
|
||||
// and they are marked as virtual stakers
|
||||
assert_eq!(Pallet::<Test>::is_virtual_staker(&200), true);
|
||||
assert_eq!(Pezpallet::<Test>::is_virtual_staker(&200), true);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -8456,7 +8456,7 @@ mod migration_tests {
|
||||
mod getters {
|
||||
use crate::{
|
||||
mock::{self},
|
||||
pallet::pallet::{Invulnerables, MinimumValidatorCount, ValidatorCount},
|
||||
pezpallet::pezpallet::{Invulnerables, MinimumValidatorCount, ValidatorCount},
|
||||
slashing,
|
||||
tests::{Staking, Test},
|
||||
ActiveEra, ActiveEraInfo, BalanceOf, CanceledSlashPayout, ClaimedRewards, CurrentEra,
|
||||
@@ -8992,7 +8992,7 @@ mod hold_migration {
|
||||
// AND Alice is partially unbonding.
|
||||
assert_ok!(Staking::unbond(RuntimeOrigin::signed(alice), 300));
|
||||
|
||||
// AND Alice has some funds reserved with another pallet.
|
||||
// AND Alice has some funds reserved with another pezpallet.
|
||||
assert_ok!(Balances::reserve(&alice, reserved_by_another_pallet));
|
||||
|
||||
// convert stake to T::OldCurrency.
|
||||
@@ -9068,7 +9068,7 @@ mod hold_migration {
|
||||
bond_virtual_nominator(200, 201, 500, vec![11, 21]);
|
||||
|
||||
// previously the virtual nominator had a provider inc by the delegation system as
|
||||
// well as a consumer by this pallet.
|
||||
// well as a consumer by this pezpallet.
|
||||
System::inc_providers(&200);
|
||||
System::inc_consumers(&200).expect("has provider, can consume");
|
||||
|
||||
|
||||
@@ -44,10 +44,10 @@
|
||||
// frame-omni-bencher
|
||||
// v1
|
||||
// benchmark
|
||||
// pallet
|
||||
// pezpallet
|
||||
// --extrinsic=*
|
||||
// --runtime=target/production/wbuild/pez-kitchensink-runtime/pez_kitchensink_runtime.wasm
|
||||
// --pallet=pezpallet_staking
|
||||
// --pezpallet=pezpallet_staking
|
||||
// --header=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/HEADER-APACHE2
|
||||
// --output=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/pezframe/staking/src/weights.rs
|
||||
// --wasm-execution=compiled
|
||||
|
||||
Reference in New Issue
Block a user