mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-30 18:57:57 +00:00
Revamp some of the weights (#4759)
* Remove free transaction dos vectors. * Bump spec version * Indentation. * Update frame/support/src/weights.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
@@ -1150,7 +1150,7 @@ decl_module! {
|
||||
}
|
||||
|
||||
/// The ideal number of validators.
|
||||
#[weight = SimpleDispatchInfo::FreeOperational]
|
||||
#[weight = SimpleDispatchInfo::FixedNormal(5_000)]
|
||||
fn set_validator_count(origin, #[compact] new: u32) {
|
||||
ensure_root(origin)?;
|
||||
ValidatorCount::put(new);
|
||||
@@ -1163,7 +1163,7 @@ decl_module! {
|
||||
/// # <weight>
|
||||
/// - No arguments.
|
||||
/// # </weight>
|
||||
#[weight = SimpleDispatchInfo::FreeOperational]
|
||||
#[weight = SimpleDispatchInfo::FixedNormal(5_000)]
|
||||
fn force_no_eras(origin) {
|
||||
ensure_root(origin)?;
|
||||
ForceEra::put(Forcing::ForceNone);
|
||||
@@ -1175,21 +1175,21 @@ decl_module! {
|
||||
/// # <weight>
|
||||
/// - No arguments.
|
||||
/// # </weight>
|
||||
#[weight = SimpleDispatchInfo::FreeOperational]
|
||||
#[weight = SimpleDispatchInfo::FixedNormal(5_000)]
|
||||
fn force_new_era(origin) {
|
||||
ensure_root(origin)?;
|
||||
ForceEra::put(Forcing::ForceNew);
|
||||
}
|
||||
|
||||
/// Set the validators who cannot be slashed (if any).
|
||||
#[weight = SimpleDispatchInfo::FreeOperational]
|
||||
#[weight = SimpleDispatchInfo::FixedNormal(5_000)]
|
||||
fn set_invulnerables(origin, validators: Vec<T::AccountId>) {
|
||||
ensure_root(origin)?;
|
||||
<Invulnerables<T>>::put(validators);
|
||||
}
|
||||
|
||||
/// Force a current staker to become completely unstaked, immediately.
|
||||
#[weight = SimpleDispatchInfo::FreeOperational]
|
||||
#[weight = SimpleDispatchInfo::FixedNormal(10_000)]
|
||||
fn force_unstake(origin, stash: T::AccountId) {
|
||||
ensure_root(origin)?;
|
||||
|
||||
@@ -1204,7 +1204,7 @@ decl_module! {
|
||||
/// # <weight>
|
||||
/// - One storage write
|
||||
/// # </weight>
|
||||
#[weight = SimpleDispatchInfo::FreeOperational]
|
||||
#[weight = SimpleDispatchInfo::FixedNormal(5_000)]
|
||||
fn force_new_era_always(origin) {
|
||||
ensure_root(origin)?;
|
||||
ForceEra::put(Forcing::ForceAlways);
|
||||
@@ -1217,7 +1217,7 @@ decl_module! {
|
||||
/// # <weight>
|
||||
/// - One storage write.
|
||||
/// # </weight>
|
||||
#[weight = SimpleDispatchInfo::FreeOperational]
|
||||
#[weight = SimpleDispatchInfo::FixedNormal(1_000_000)]
|
||||
fn cancel_deferred_slash(origin, era: EraIndex, slash_indices: Vec<u32>) {
|
||||
T::SlashCancelOrigin::try_origin(origin)
|
||||
.map(|_| ())
|
||||
|
||||
Reference in New Issue
Block a user