Skip to content

Commit

Permalink
Merge pull request #717 from galacticcouncil/pallet_storage_versions
Browse files Browse the repository at this point in the history
feat: add missing storage versions to pallets
  • Loading branch information
mrq1911 authored Jan 20, 2024
2 parents 34ff15f + a156521 commit d64f610
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
5 changes: 5 additions & 0 deletions pallets/collator-rewards/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ pub mod pallet {
use frame_support::sp_runtime::traits::AtLeast32BitUnsigned;
use frame_system::pallet_prelude::BlockNumberFor;

/// The current storage version.
const STORAGE_VERSION: StorageVersion = StorageVersion::new(1);

#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::storage_version(STORAGE_VERSION)]
pub struct Pallet<T>(_);

#[pallet::hooks]
Expand Down
8 changes: 6 additions & 2 deletions pallets/genesis-history/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,16 @@ pub mod pallet {
use frame_support::pallet_prelude::*;
use frame_system::pallet_prelude::*;

#[pallet::config]
pub trait Config: frame_system::Config {}
/// The current storage version.
const STORAGE_VERSION: StorageVersion = StorageVersion::new(1);

#[pallet::pallet]
#[pallet::storage_version(STORAGE_VERSION)]
pub struct Pallet<T>(_);

#[pallet::config]
pub trait Config: frame_system::Config {}

#[pallet::storage]
#[pallet::getter(fn previous_chain)]
pub type PreviousChain<T: Config> = StorageValue<_, Chain, ValueQuery>;
Expand Down
11 changes: 8 additions & 3 deletions pallets/transaction-pause/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ pub use weights::WeightInfo;
pub mod pallet {
use super::*;

/// The current storage version.
const STORAGE_VERSION: StorageVersion = StorageVersion::new(1);

#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::storage_version(STORAGE_VERSION)]
pub struct Pallet<T>(_);

// max length of a pallet name or function name
pub const MAX_STR_LENGTH: u32 = 40;
pub type BoundedName = BoundedVec<u8, ConstU32<MAX_STR_LENGTH>>;
Expand Down Expand Up @@ -88,9 +96,6 @@ pub mod pallet {
#[pallet::getter(fn paused_transactions)]
pub type PausedTransactions<T: Config> = StorageMap<_, Twox64Concat, (BoundedName, BoundedName), (), OptionQuery>;

#[pallet::pallet]
pub struct Pallet<T>(_);

#[pallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}

Expand Down

0 comments on commit d64f610

Please sign in to comment.