mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 23:57:56 +00:00
Parachains configuration.rs FrameV2 (#3516)
* migration * genesis build correctly * migrate runtimes * add genesis builds * expose GenesisBuild * chainspec migration * fmt * check before insert * Reduce visibility of storage items to crate Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
This commit is contained in:
@@ -28,7 +28,7 @@ use sp_keystore::{KeystoreExt, testing::KeyStore};
|
||||
use primitives::v1::{BlockNumber, Header, Id as ParaId, ValidationCode, HeadData, LOWEST_PUBLIC_ID};
|
||||
use frame_support::{
|
||||
parameter_types, assert_ok, assert_noop, PalletId,
|
||||
traits::{Currency, OnInitialize, OnFinalize, KeyOwnerProofSystem},
|
||||
traits::{Currency, OnInitialize, OnFinalize, KeyOwnerProofSystem, GenesisBuild},
|
||||
};
|
||||
use frame_system::EnsureRoot;
|
||||
use runtime_parachains::{
|
||||
@@ -234,13 +234,16 @@ impl crowdloan::Config for Test {
|
||||
/// Create a new set of test externalities.
|
||||
pub fn new_test_ext() -> TestExternalities {
|
||||
let mut t = frame_system::GenesisConfig::default().build_storage::<Test>().unwrap();
|
||||
configuration::GenesisConfig::<Test> {
|
||||
config: configuration::HostConfiguration {
|
||||
max_code_size: 2 * 1024 * 1024, // 2 MB
|
||||
max_head_data_size: 1 * 1024 * 1024, // 1 MB
|
||||
..Default::default()
|
||||
},
|
||||
}.assimilate_storage(&mut t).unwrap();
|
||||
GenesisBuild::<Test>::assimilate_storage(
|
||||
&configuration::GenesisConfig {
|
||||
config: configuration::HostConfiguration {
|
||||
max_code_size: 2 * 1024 * 1024, // 2 MB
|
||||
max_head_data_size: 1 * 1024 * 1024, // 1 MB
|
||||
..Default::default()
|
||||
}
|
||||
},
|
||||
&mut t
|
||||
).unwrap();
|
||||
let keystore = KeyStore::new();
|
||||
let mut ext: sp_io::TestExternalities = t.into();
|
||||
ext.register_extension(KeystoreExt(Arc::new(keystore)));
|
||||
|
||||
Reference in New Issue
Block a user