Skip to content

Commit

Permalink
panic if event is not found in the expected blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
lemunozm committed Jun 20, 2024
1 parent 4363f8b commit a10735e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions runtime/integration-tests/src/generic/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,23 @@ pub trait Env<T: Runtime>: Default {
)
});

let mut found_event = false;
for i in blocks.range_for(current, slot) {
self.__priv_build_block(i);

if let Blocks::UntilEvent { event, .. } = blocks.clone() {
if self.check_event(event).is_some() {
found_event = true;
break;
}
}
}

if let Blocks::UntilEvent { event, limit } = blocks.clone() {
if !found_event {
panic!("Event {event:?} was not found producing {limit} blocks");
}
}
}

/// Allows to mutate the relay storage state through the closure.
Expand Down

0 comments on commit a10735e

Please sign in to comment.