Prevent events from being emitted during genesis construction (#5463)

* Don't populate runtime events in genesis

* typo

* Change to block zero

* Fix vesting tests

* Update frame/system/src/lib.rs

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>

* Update frame/system/src/lib.rs

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>

* Add test

* Fix test

* Fix contract tests

* Fix phragmen tests

* Fix Generic Assets Tests

* Fix offences tests

* Fix im-online

* fix recovery

* Fix utility tests

* Shorter

* Use ext

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
Shawn Tabrizi
2020-03-31 15:57:08 +02:00
committed by GitHub
parent b472d60a52
commit 2e76e2a74d
22 changed files with 72 additions and 109 deletions
+10 -9
View File
@@ -127,16 +127,17 @@ impl ExtBuilder {
let mut t = frame_system::GenesisConfig::default().build_storage::<Test>().unwrap();
GenesisConfig::<Test> {
assets: vec![self.asset_id],
endowed_accounts: self.accounts,
initial_balance: self.initial_balance,
next_asset_id: self.next_asset_id,
staking_asset_id: 16000,
spending_asset_id: 16001,
}
.assimilate_storage(&mut t).unwrap();
assets: vec![self.asset_id],
endowed_accounts: self.accounts,
initial_balance: self.initial_balance,
next_asset_id: self.next_asset_id,
staking_asset_id: 16000,
spending_asset_id: 16001,
}.assimilate_storage(&mut t).unwrap();
t.into()
let mut ext = sp_io::TestExternalities::new(t);
ext.execute_with(|| System::set_block_number(1));
ext
}
}