mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 01:11:10 +00:00
Migrate away from SimpleDispatchInfo (#5686)
* Migrate away from SimpleDispatchInfo * Fix imports * Better doc * Update lib.rs Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
@@ -23,7 +23,7 @@ use sp_runtime::traits::{One, Zero, SaturatedConversion};
|
||||
use sp_std::{prelude::*, result, cmp, vec};
|
||||
use frame_support::{decl_module, decl_storage, decl_error, ensure};
|
||||
use frame_support::traits::Get;
|
||||
use frame_support::weights::{SimpleDispatchInfo, MINIMUM_WEIGHT};
|
||||
use frame_support::weights::{MINIMUM_WEIGHT, DispatchClass};
|
||||
use frame_system::{ensure_none, Trait as SystemTrait};
|
||||
use sp_finality_tracker::{INHERENT_IDENTIFIER, FinalizedInherentData};
|
||||
|
||||
@@ -77,7 +77,7 @@ decl_module! {
|
||||
|
||||
/// Hint that the author of this block thinks the best finalized
|
||||
/// block is the given number.
|
||||
#[weight = SimpleDispatchInfo::FixedMandatory(MINIMUM_WEIGHT)]
|
||||
#[weight = (MINIMUM_WEIGHT, DispatchClass::Mandatory)]
|
||||
fn final_hint(origin, #[compact] hint: T::BlockNumber) {
|
||||
ensure_none(origin)?;
|
||||
ensure!(!<Self as Store>::Update::exists(), Error::<T>::AlreadyUpdated);
|
||||
@@ -212,7 +212,9 @@ mod tests {
|
||||
traits::{BlakeTwo256, IdentityLookup, Header as HeaderT},
|
||||
};
|
||||
use frame_support::{
|
||||
assert_ok, impl_outer_origin, parameter_types, weights::Weight, traits::OnFinalize
|
||||
assert_ok, impl_outer_origin, parameter_types,
|
||||
weights::Weight,
|
||||
traits::OnFinalize,
|
||||
};
|
||||
use frame_system as system;
|
||||
use std::cell::RefCell;
|
||||
|
||||
Reference in New Issue
Block a user