mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 11:38:01 +00:00
Make use of child storage for testExternalities and basicExternalities (#3009)
* impl test using both storage and child_storage * few fixes * remove unused code * impl PartialEq with children keys * fmt * implementation of basic with children + rename new * assert and test * no panic in runtime * address comments * fix
This commit is contained in:
@@ -563,17 +563,16 @@ mod tests {
|
||||
};
|
||||
|
||||
fn new_test_ext() -> runtime_io::TestExternalities<Blake2Hasher> {
|
||||
TEST_SESSION_CHANGED.with(|l| *l.borrow_mut() = false);
|
||||
let mut t = system::GenesisConfig::default().build_storage::<Test>().unwrap().0;
|
||||
t.extend(timestamp::GenesisConfig::<Test> {
|
||||
let mut t = system::GenesisConfig::default().build_storage::<Test>().unwrap();
|
||||
timestamp::GenesisConfig::<Test> {
|
||||
minimum_period: 5,
|
||||
}.build_storage().unwrap().0);
|
||||
t.extend(GenesisConfig::<Test> {
|
||||
}.assimilate_storage(&mut t.0, &mut t.1).unwrap();
|
||||
GenesisConfig::<Test> {
|
||||
keys: NEXT_VALIDATORS.with(|l|
|
||||
l.borrow().iter().cloned().map(|i| (i, UintAuthorityId(i))).collect()
|
||||
),
|
||||
}.build_storage().unwrap().0);
|
||||
runtime_io::TestExternalities::new(t)
|
||||
}.assimilate_storage(&mut t.0, &mut t.1).unwrap();
|
||||
runtime_io::TestExternalities::new_with_children(t)
|
||||
}
|
||||
|
||||
fn initialize_block(block: u64) {
|
||||
|
||||
Reference in New Issue
Block a user