mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 07:41:08 +00:00
frame_support::pallet_prelude: reexport StorageVersion (#11408)
* frame_support::pallet_prelude: reexport StorageVersion Signed-off-by: koushiro <koushiro.cqx@gmail.com> * cargo fmt Signed-off-by: koushiro <koushiro.cqx@gmail.com>
This commit is contained in:
@@ -51,9 +51,7 @@ use frame_support::{
|
||||
codec::{Decode, Encode},
|
||||
dispatch::{DispatchError, DispatchResultWithPostInfo, Dispatchable, PostDispatchInfo},
|
||||
ensure,
|
||||
traits::{
|
||||
Backing, ChangeMembers, EnsureOrigin, Get, GetBacking, InitializeMembers, StorageVersion,
|
||||
},
|
||||
traits::{Backing, ChangeMembers, EnsureOrigin, Get, GetBacking, InitializeMembers},
|
||||
weights::{GetDispatchInfo, Weight},
|
||||
};
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ use super::{Event as CollectiveEvent, *};
|
||||
use crate as pallet_collective;
|
||||
use frame_support::{
|
||||
assert_noop, assert_ok, parameter_types,
|
||||
traits::{ConstU32, ConstU64, GenesisBuild},
|
||||
traits::{ConstU32, ConstU64, GenesisBuild, StorageVersion},
|
||||
weights::Pays,
|
||||
Hashable,
|
||||
};
|
||||
|
||||
@@ -114,7 +114,7 @@ use codec::{Encode, HasCompact};
|
||||
use frame_support::{
|
||||
dispatch::Dispatchable,
|
||||
ensure,
|
||||
traits::{Contains, Currency, Get, Randomness, ReservableCurrency, StorageVersion, Time},
|
||||
traits::{Contains, Currency, Get, Randomness, ReservableCurrency, Time},
|
||||
weights::{DispatchClass, GetDispatchInfo, Pays, PostDispatchInfo, Weight},
|
||||
};
|
||||
use frame_system::{limits::BlockWeights, Pallet as System};
|
||||
@@ -133,9 +133,6 @@ type TrieId = Vec<u8>;
|
||||
type BalanceOf<T> =
|
||||
<<T as Config>::Currency as Currency<<T as frame_system::Config>::AccountId>>::Balance;
|
||||
|
||||
/// The current storage version.
|
||||
const STORAGE_VERSION: StorageVersion = StorageVersion::new(7);
|
||||
|
||||
/// Used as a sentinel value when reading and writing contract memory.
|
||||
///
|
||||
/// It is usually used to signal `None` to a contract when only a primitive is allowed
|
||||
@@ -222,6 +219,14 @@ pub mod pallet {
|
||||
use frame_support::pallet_prelude::*;
|
||||
use frame_system::pallet_prelude::*;
|
||||
|
||||
/// The current storage version.
|
||||
const STORAGE_VERSION: StorageVersion = StorageVersion::new(7);
|
||||
|
||||
#[pallet::pallet]
|
||||
#[pallet::storage_version(STORAGE_VERSION)]
|
||||
#[pallet::without_storage_info]
|
||||
pub struct Pallet<T>(PhantomData<T>);
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: frame_system::Config {
|
||||
/// The time implementation used to supply timestamps to conntracts through `seal_now`.
|
||||
@@ -353,11 +358,6 @@ pub mod pallet {
|
||||
type AddressGenerator: AddressGenerator<Self>;
|
||||
}
|
||||
|
||||
#[pallet::pallet]
|
||||
#[pallet::storage_version(STORAGE_VERSION)]
|
||||
#[pallet::without_storage_info]
|
||||
pub struct Pallet<T>(PhantomData<T>);
|
||||
|
||||
#[pallet::hooks]
|
||||
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T>
|
||||
where
|
||||
|
||||
@@ -28,8 +28,6 @@ use sp_std::{marker::PhantomData, prelude::*};
|
||||
|
||||
/// Wrapper for all migrations of this pallet, based on `StorageVersion`.
|
||||
pub fn migrate<T: Config>() -> Weight {
|
||||
use frame_support::traits::StorageVersion;
|
||||
|
||||
let version = StorageVersion::get::<Pallet<T>>();
|
||||
let mut weight: Weight = 0;
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ use frame_support::{
|
||||
traits::{
|
||||
defensive_prelude::*, ChangeMembers, Contains, ContainsLengthBound, Currency,
|
||||
CurrencyToVote, Get, InitializeMembers, LockIdentifier, LockableCurrency, OnUnbalanced,
|
||||
ReservableCurrency, SortedMembers, StorageVersion, WithdrawReasons,
|
||||
ReservableCurrency, SortedMembers, WithdrawReasons,
|
||||
},
|
||||
weights::Weight,
|
||||
};
|
||||
@@ -123,9 +123,6 @@ pub use weights::WeightInfo;
|
||||
/// All migrations.
|
||||
pub mod migrations;
|
||||
|
||||
/// The current storage version.
|
||||
const STORAGE_VERSION: StorageVersion = StorageVersion::new(4);
|
||||
|
||||
/// The maximum votes allowed per voter.
|
||||
pub const MAXIMUM_VOTE: usize = 16;
|
||||
|
||||
@@ -186,6 +183,15 @@ pub mod pallet {
|
||||
use frame_support::pallet_prelude::*;
|
||||
use frame_system::pallet_prelude::*;
|
||||
|
||||
/// The current storage version.
|
||||
const STORAGE_VERSION: StorageVersion = StorageVersion::new(4);
|
||||
|
||||
#[pallet::pallet]
|
||||
#[pallet::generate_store(pub(super) trait Store)]
|
||||
#[pallet::storage_version(STORAGE_VERSION)]
|
||||
#[pallet::without_storage_info]
|
||||
pub struct Pallet<T>(PhantomData<T>);
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: frame_system::Config {
|
||||
type Event: From<Event<Self>> + IsType<<Self as frame_system::Config>::Event>;
|
||||
@@ -247,12 +253,6 @@ pub mod pallet {
|
||||
type WeightInfo: WeightInfo;
|
||||
}
|
||||
|
||||
#[pallet::pallet]
|
||||
#[pallet::generate_store(pub(super) trait Store)]
|
||||
#[pallet::storage_version(STORAGE_VERSION)]
|
||||
#[pallet::without_storage_info]
|
||||
pub struct Pallet<T>(PhantomData<T>);
|
||||
|
||||
#[pallet::hooks]
|
||||
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {
|
||||
/// What to do at the end of each block.
|
||||
|
||||
@@ -43,10 +43,11 @@ use frame_support::{
|
||||
dispatch::DispatchResultWithPostInfo,
|
||||
pallet_prelude::Get,
|
||||
storage,
|
||||
traits::{KeyOwnerProofSystem, OneSessionHandler, StorageVersion},
|
||||
traits::{KeyOwnerProofSystem, OneSessionHandler},
|
||||
weights::{Pays, Weight},
|
||||
WeakBoundedVec,
|
||||
};
|
||||
use scale_info::TypeInfo;
|
||||
use sp_runtime::{generic::DigestItem, traits::Zero, DispatchResult, KeyTypeId};
|
||||
use sp_session::{GetSessionNumber, GetValidatorCount};
|
||||
use sp_staking::SessionIndex;
|
||||
@@ -69,17 +70,15 @@ pub use equivocation::{
|
||||
|
||||
pub use pallet::*;
|
||||
|
||||
use scale_info::TypeInfo;
|
||||
|
||||
/// The current storage version.
|
||||
const STORAGE_VERSION: StorageVersion = StorageVersion::new(4);
|
||||
|
||||
#[frame_support::pallet]
|
||||
pub mod pallet {
|
||||
use super::*;
|
||||
use frame_support::{dispatch::DispatchResult, pallet_prelude::*};
|
||||
use frame_system::pallet_prelude::*;
|
||||
|
||||
/// The current storage version.
|
||||
const STORAGE_VERSION: StorageVersion = StorageVersion::new(4);
|
||||
|
||||
#[pallet::pallet]
|
||||
#[pallet::generate_store(pub(super) trait Store)]
|
||||
#[pallet::storage_version(STORAGE_VERSION)]
|
||||
|
||||
@@ -23,9 +23,7 @@
|
||||
// Ensure we're `no_std` when compiling for Wasm.
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
use frame_support::traits::{
|
||||
ChangeMembers, Contains, Get, InitializeMembers, SortedMembers, StorageVersion,
|
||||
};
|
||||
use frame_support::traits::{ChangeMembers, Contains, Get, InitializeMembers, SortedMembers};
|
||||
use sp_std::prelude::*;
|
||||
|
||||
pub mod migrations;
|
||||
@@ -507,7 +505,7 @@ mod tests {
|
||||
|
||||
use frame_support::{
|
||||
assert_noop, assert_ok, ord_parameter_types, parameter_types,
|
||||
traits::{ConstU32, ConstU64, GenesisBuild},
|
||||
traits::{ConstU32, ConstU64, GenesisBuild, StorageVersion},
|
||||
};
|
||||
use frame_system::EnsureSignedBy;
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ use sp_trie::{
|
||||
|
||||
use frame_support::{
|
||||
print,
|
||||
traits::{KeyOwnerProofSystem, StorageVersion, ValidatorSet, ValidatorSetWithIdentification},
|
||||
traits::{KeyOwnerProofSystem, ValidatorSet, ValidatorSetWithIdentification},
|
||||
Parameter,
|
||||
};
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ use frame_support::{
|
||||
ensure,
|
||||
traits::{
|
||||
EstimateNextNewSession, EstimateNextSessionRotation, FindAuthor, Get, OneSessionHandler,
|
||||
StorageVersion, ValidatorRegistration, ValidatorSet,
|
||||
ValidatorRegistration, ValidatorSet,
|
||||
},
|
||||
weights::Weight,
|
||||
Parameter,
|
||||
|
||||
@@ -459,7 +459,7 @@ fn test_migration_v1() {
|
||||
historical::{HistoricalSessions, StoredRange},
|
||||
mock::Historical,
|
||||
};
|
||||
use frame_support::traits::PalletInfoAccess;
|
||||
use frame_support::traits::{PalletInfoAccess, StorageVersion};
|
||||
|
||||
new_test_ext().execute_with(|| {
|
||||
assert!(<HistoricalSessions<Test>>::iter_values().count() > 0);
|
||||
|
||||
@@ -1409,7 +1409,7 @@ pub mod pallet_prelude {
|
||||
},
|
||||
traits::{
|
||||
ConstU32, EnsureOrigin, Get, GetDefault, GetStorageVersion, Hooks, IsType,
|
||||
PalletInfoAccess, StorageInfoTrait,
|
||||
PalletInfoAccess, StorageInfoTrait, StorageVersion,
|
||||
},
|
||||
weights::{DispatchClass, Pays, Weight},
|
||||
Blake2_128, Blake2_128Concat, Blake2_256, CloneNoBound, DebugNoBound, EqNoBound, Identity,
|
||||
|
||||
@@ -96,13 +96,9 @@ impl SomeAssociation2 for u64 {
|
||||
|
||||
#[frame_support::pallet]
|
||||
pub mod pallet {
|
||||
use super::{
|
||||
SomeAssociation1, SomeAssociation2, SomeType1, SomeType2, SomeType3, SomeType4, SomeType5,
|
||||
SomeType6, SomeType7, StorageVersion,
|
||||
};
|
||||
use super::*;
|
||||
use frame_support::pallet_prelude::*;
|
||||
use frame_system::pallet_prelude::*;
|
||||
use scale_info::TypeInfo;
|
||||
|
||||
type BalanceOf<T> = <T as Config>::Balance;
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ use codec::{Decode, Encode};
|
||||
use frame_support::{
|
||||
traits::{
|
||||
ContainsLengthBound, Currency, EnsureOrigin, ExistenceRequirement::KeepAlive, Get,
|
||||
OnUnbalanced, ReservableCurrency, SortedMembers, StorageVersion,
|
||||
OnUnbalanced, ReservableCurrency, SortedMembers,
|
||||
},
|
||||
Parameter,
|
||||
};
|
||||
|
||||
@@ -34,7 +34,7 @@ use frame_support::{
|
||||
pallet_prelude::GenesisBuild,
|
||||
parameter_types,
|
||||
storage::StoragePrefixedMap,
|
||||
traits::{ConstU32, ConstU64, SortedMembers},
|
||||
traits::{ConstU32, ConstU64, SortedMembers, StorageVersion},
|
||||
PalletId,
|
||||
};
|
||||
|
||||
|
||||
@@ -57,15 +57,15 @@ pub mod weights;
|
||||
|
||||
use codec::{Decode, Encode, MaxEncodedLen};
|
||||
use frame_support::{
|
||||
dispatch::{DispatchError, DispatchResult},
|
||||
ensure,
|
||||
pallet_prelude::*,
|
||||
storage::bounded_vec::BoundedVec,
|
||||
traits::{
|
||||
Currency, ExistenceRequirement, Get, LockIdentifier, LockableCurrency, VestingSchedule,
|
||||
WithdrawReasons,
|
||||
},
|
||||
weights::Weight,
|
||||
};
|
||||
use frame_system::{ensure_root, ensure_signed, pallet_prelude::*};
|
||||
pub use pallet::*;
|
||||
use scale_info::TypeInfo;
|
||||
use sp_runtime::{
|
||||
traits::{
|
||||
@@ -74,7 +74,9 @@ use sp_runtime::{
|
||||
},
|
||||
RuntimeDebug,
|
||||
};
|
||||
use sp_std::{fmt::Debug, prelude::*};
|
||||
use sp_std::{fmt::Debug, marker::PhantomData, prelude::*};
|
||||
|
||||
pub use pallet::*;
|
||||
pub use vesting_info::*;
|
||||
pub use weights::WeightInfo;
|
||||
|
||||
@@ -146,6 +148,8 @@ impl<T: Config> Get<u32> for MaxVestingSchedulesGet<T> {
|
||||
#[frame_support::pallet]
|
||||
pub mod pallet {
|
||||
use super::*;
|
||||
use frame_support::pallet_prelude::*;
|
||||
use frame_system::pallet_prelude::*;
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: frame_system::Config {
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
use frame_support::{
|
||||
parameter_types,
|
||||
traits::{ConstU32, ConstU64},
|
||||
traits::{ConstU32, ConstU64, GenesisBuild},
|
||||
};
|
||||
use sp_core::H256;
|
||||
use sp_runtime::{
|
||||
|
||||
Reference in New Issue
Block a user