Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Don't populate runtime events in genesis
  • Loading branch information
shawntabrizi committed Mar 30, 2020
commit 8a65beeeafce728c28bdd4afddc886c1d0543d5f
5 changes: 4 additions & 1 deletion frame/system/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,10 @@ impl<T: Trait> Module<T> {
/// This will update storage entries that correspond to the specified topics.
/// It is expected that light-clients could subscribe to this topics.
pub fn deposit_event_indexed(topics: &[T::Hash], event: T::Event) {
let block_no = Self::block_number();
// Don't populate events on genesis.
if block_no == T::BlockNumber::One() { return }

let phase = ExecutionPhase::get().unwrap_or_default();
let event = EventRecord {
phase,
Expand Down Expand Up @@ -781,7 +785,6 @@ impl<T: Trait> Module<T> {
return;
}

let block_no = Self::block_number();
for topic in topics {
// The same applies here.
if <EventTopics<T>>::append(topic, &[(block_no, event_idx)]).is_err() {
Expand Down