Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Revert "frame: ambiguity BuildStorage vs GenesisBuild fixed"
Browse files Browse the repository at this point in the history
This reverts commit 6017dad.
  • Loading branch information
michalkucharczyk committed Jun 12, 2023
1 parent 3c131b6 commit 2b1ecd4
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 19 deletions.
5 changes: 3 additions & 2 deletions frame/bounties/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,13 @@ type TreasuryError = pallet_treasury::Error<Test>;
type TreasuryError1 = pallet_treasury::Error<Test, Instance1>;

pub fn new_test_ext() -> sp_io::TestExternalities {
let mut ext: sp_io::TestExternalities = BuildStorage::build_storage(&RuntimeGenesisConfig {
let mut ext: sp_io::TestExternalities = RuntimeGenesisConfig {
system: frame_system::GenesisConfig::default(),
balances: pallet_balances::GenesisConfig { balances: vec![(0, 100), (1, 98), (2, 1)] },
treasury: Default::default(),
treasury_1: Default::default(),
})
}
.build_storage()
.unwrap()
.into();
ext.execute_with(|| System::set_block_number(1));
Expand Down
28 changes: 14 additions & 14 deletions frame/collective/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,20 +177,20 @@ impl ExtBuilder {
}

pub fn build(self) -> sp_io::TestExternalities {
let mut ext: sp_io::TestExternalities =
BuildStorage::build_storage(&RuntimeGenesisConfig {
collective: pallet_collective::GenesisConfig {
members: self.collective_members,
phantom: Default::default(),
},
collective_majority: pallet_collective::GenesisConfig {
members: vec![1, 2, 3, 4, 5],
phantom: Default::default(),
},
default_collective: Default::default(),
})
.unwrap()
.into();
let mut ext: sp_io::TestExternalities = RuntimeGenesisConfig {
collective: pallet_collective::GenesisConfig {
members: self.collective_members,
phantom: Default::default(),
},
collective_majority: pallet_collective::GenesisConfig {
members: vec![1, 2, 3, 4, 5],
phantom: Default::default(),
},
default_collective: Default::default(),
}
.build_storage()
.unwrap()
.into();
ext.execute_with(|| System::set_block_number(1));
ext
}
Expand Down
2 changes: 1 addition & 1 deletion frame/system/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ pub const CALL: &<Test as Config>::RuntimeCall =
/// Create new externalities for `System` module tests.
pub fn new_test_ext() -> sp_io::TestExternalities {
let mut ext: sp_io::TestExternalities =
BuildStorage::build_storage(&RuntimeGenesisConfig::default()).unwrap().into();
RuntimeGenesisConfig::default().build_storage().unwrap().into();
// Add to each test the initial weight of a block
ext.execute_with(|| {
System::register_extra_weight_unchecked(
Expand Down
5 changes: 3 additions & 2 deletions frame/tips/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,13 @@ impl Config<Instance1> for Test {
}

pub fn new_test_ext() -> sp_io::TestExternalities {
let mut ext: sp_io::TestExternalities = BuildStorage::build_storage(&RuntimeGenesisConfig {
let mut ext: sp_io::TestExternalities = RuntimeGenesisConfig {
system: frame_system::GenesisConfig::default(),
balances: pallet_balances::GenesisConfig { balances: vec![(0, 100), (1, 98), (2, 1)] },
treasury: Default::default(),
treasury_1: Default::default(),
})
}
.build_storage()
.unwrap()
.into();
ext.execute_with(|| System::set_block_number(1));
Expand Down

0 comments on commit 2b1ecd4

Please sign in to comment.