mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 06:21:02 +00:00
GenesisBuild<T,I> deprecated. BuildGenesisConfig added (#7397)
* GenesisBuild<T,I> deprecated. BuildGenesisConfig added
* fmt
* fixes
* more fixes
* more fixes
* fixes
* update lockfile for {"substrate"}
* fix
---------
Co-authored-by: parity-processbot <>
This commit is contained in:
committed by
GitHub
parent
bcb9bd0432
commit
95ba849ee6
@@ -528,7 +528,7 @@ pub mod pallet {
|
||||
}
|
||||
|
||||
#[pallet::genesis_build]
|
||||
impl<T: Config> GenesisBuild<T> for GenesisConfig<T> {
|
||||
impl<T: Config> BuildGenesisConfig for GenesisConfig<T> {
|
||||
fn build(&self) {
|
||||
self.config.panic_if_not_consistent();
|
||||
ActiveConfig::<T>::put(&self.config);
|
||||
|
||||
@@ -436,12 +436,14 @@ pub mod pallet {
|
||||
/// 2. `sender` and `recipient` must be valid paras.
|
||||
#[pallet::genesis_config]
|
||||
#[derive(DefaultNoBound)]
|
||||
pub struct GenesisConfig {
|
||||
pub struct GenesisConfig<T: Config> {
|
||||
#[serde(skip)]
|
||||
_config: sp_std::marker::PhantomData<T>,
|
||||
preopen_hrmp_channels: Vec<(ParaId, ParaId, u32, u32)>,
|
||||
}
|
||||
|
||||
#[pallet::genesis_build]
|
||||
impl<T: Config> GenesisBuild<T> for GenesisConfig {
|
||||
impl<T: Config> BuildGenesisConfig for GenesisConfig<T> {
|
||||
fn build(&self) {
|
||||
initialize_storage::<T>(&self.preopen_hrmp_channels);
|
||||
}
|
||||
|
||||
@@ -27,8 +27,7 @@ use crate::{
|
||||
use frame_support::{
|
||||
assert_ok, parameter_types,
|
||||
traits::{
|
||||
Currency, GenesisBuild, ProcessMessage, ProcessMessageError, ValidatorSet,
|
||||
ValidatorSetWithIdentification,
|
||||
Currency, ProcessMessage, ProcessMessageError, ValidatorSet, ValidatorSetWithIdentification,
|
||||
},
|
||||
weights::{Weight, WeightMeter},
|
||||
};
|
||||
@@ -43,7 +42,7 @@ use sp_io::TestExternalities;
|
||||
use sp_runtime::{
|
||||
traits::{AccountIdConversion, BlakeTwo256, IdentityLookup},
|
||||
transaction_validity::TransactionPriority,
|
||||
Permill,
|
||||
BuildStorage, Permill,
|
||||
};
|
||||
use std::{cell::RefCell, collections::HashMap};
|
||||
|
||||
@@ -485,9 +484,9 @@ pub fn new_test_ext(state: MockGenesisConfig) -> TestExternalities {
|
||||
BACKING_REWARDS.with(|r| r.borrow_mut().clear());
|
||||
AVAILABILITY_REWARDS.with(|r| r.borrow_mut().clear());
|
||||
|
||||
let mut t = state.system.build_storage::<Test>().unwrap();
|
||||
let mut t = state.system.build_storage().unwrap();
|
||||
state.configuration.assimilate_storage(&mut t).unwrap();
|
||||
GenesisBuild::<Test>::assimilate_storage(&state.paras, &mut t).unwrap();
|
||||
state.paras.assimilate_storage(&mut t).unwrap();
|
||||
|
||||
let mut ext: TestExternalities = t.into();
|
||||
ext.register_extension(KeystoreExt(Arc::new(MemoryKeystore::new()) as KeystorePtr));
|
||||
@@ -497,9 +496,9 @@ pub fn new_test_ext(state: MockGenesisConfig) -> TestExternalities {
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct MockGenesisConfig {
|
||||
pub system: frame_system::GenesisConfig,
|
||||
pub system: frame_system::GenesisConfig<Test>,
|
||||
pub configuration: crate::configuration::GenesisConfig<Test>,
|
||||
pub paras: crate::paras::GenesisConfig,
|
||||
pub paras: crate::paras::GenesisConfig<Test>,
|
||||
}
|
||||
|
||||
pub fn assert_last_event(generic_event: RuntimeEvent) {
|
||||
|
||||
@@ -768,12 +768,14 @@ pub mod pallet {
|
||||
|
||||
#[pallet::genesis_config]
|
||||
#[derive(DefaultNoBound)]
|
||||
pub struct GenesisConfig {
|
||||
pub struct GenesisConfig<T: Config> {
|
||||
#[serde(skip)]
|
||||
pub _config: sp_std::marker::PhantomData<T>,
|
||||
pub paras: Vec<(ParaId, ParaGenesisArgs)>,
|
||||
}
|
||||
|
||||
#[pallet::genesis_build]
|
||||
impl<T: Config> GenesisBuild<T> for GenesisConfig {
|
||||
impl<T: Config> BuildGenesisConfig for GenesisConfig<T> {
|
||||
fn build(&self) {
|
||||
let mut parachains = ParachainsCache::new();
|
||||
for (id, genesis_args) in &self.paras {
|
||||
|
||||
Reference in New Issue
Block a user