mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-06 03:18:01 +00:00
frame: Enable GenesisConfig in no_std (#14108)
* frame: Default for GenesisConfig in no_std
`Default` for `GenesisConfig` will be required for no_std in no native
runtime world. It must be possible to instantiate default GenesisConfig
for pallets and runtime.
* ".git/.scripts/commands/fmt/fmt.sh"
* hash69 in no_std reverted
* derive(DefaultNoBound) for GenesisConfig used when possible
* treasury: derive(Default)
* Cargo.lock update
* genesis_config: compiler error improved
When std feature is not enabled for pallet, the GenesisConfig will be
defined, but serde::{Serialize,Deserialize} traits will not be
implemented.
The compiler error indicates the reason of latter errors.
This is temporary and serde traits will be enabled with together with
`serde` support in frame.
---------
Co-authored-by: command-bot <>
This commit is contained in:
committed by
GitHub
parent
5100a0376e
commit
613420a035
@@ -369,6 +369,7 @@ pub mod pallet {
|
||||
>;
|
||||
|
||||
#[pallet::genesis_config]
|
||||
#[derive(frame_support::DefaultNoBound)]
|
||||
pub struct GenesisConfig<T: Config<I>, I: 'static = ()> {
|
||||
/// Genesis assets: id, owner, is_sufficient, min_balance
|
||||
pub assets: Vec<(T::AssetId, T::AccountId, bool, T::Balance)>,
|
||||
@@ -378,17 +379,6 @@ pub mod pallet {
|
||||
pub accounts: Vec<(T::AssetId, T::AccountId, T::Balance)>,
|
||||
}
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
impl<T: Config<I>, I: 'static> Default for GenesisConfig<T, I> {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
assets: Default::default(),
|
||||
metadata: Default::default(),
|
||||
accounts: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[pallet::genesis_build]
|
||||
impl<T: Config<I>, I: 'static> GenesisBuild<T, I> for GenesisConfig<T, I> {
|
||||
fn build(&self) {
|
||||
|
||||
Reference in New Issue
Block a user