From 81e4404a75c5da1908bf8cb22d6e04ddac9af05e Mon Sep 17 00:00:00 2001 From: PraetorP Date: Thu, 20 Apr 2023 08:26:42 +0000 Subject: [PATCH] feat(pallet nft): added GenesisConfig --- --- a/node/cli/src/chain_spec.rs +++ b/node/cli/src/chain_spec.rs @@ -168,6 +168,7 @@ .collect(), }, common: Default::default(), + nonfungible: Default::default(), treasury: Default::default(), tokens: TokensConfig { balances: vec![] }, sudo: SudoConfig { @@ -227,6 +228,7 @@ .to_vec(), }, common: Default::default(), + nonfungible: Default::default(), balances: BalancesConfig { balances: $endowed_accounts .iter() --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -496,6 +496,7 @@ StorageVersion::new(1).put::>(); } } + impl Pallet { /// Helper function that handles deposit events pub fn deposit_event(event: Event) { --- a/pallets/nonfungible/src/lib.rs +++ b/pallets/nonfungible/src/lib.rs @@ -281,6 +281,23 @@ Value = bool, QueryKind = ValueQuery, >; + + #[pallet::genesis_config] + pub struct GenesisConfig(PhantomData); + + #[cfg(feature = "std")] + impl Default for GenesisConfig { + fn default() -> Self { + Self(Default::default()) + } + } + + #[pallet::genesis_build] + impl GenesisBuild for GenesisConfig { + fn build(&self) { + StorageVersion::new(1).put::>(); + } + } } pub struct NonfungibleHandle(pallet_common::CollectionHandle); -- gitstuff