Skip to content

Commit 307630f

Browse files
committed
feat: skip genesis block
Signed-off-by: quacumque <quacumque@fastmail.jp>
1 parent 4d4ee15 commit 307630f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

trigger/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,11 @@ fn main(host: Iroha, ctx: Context) {
136136
fn main_result(host: Iroha, ctx: Context) -> Result<()> {
137137
info!("Hello from the Hub Chain Trigger!");
138138

139+
if ctx.curr_block.is_genesis() {
140+
debug!("Skipping genesis block");
141+
return Ok(());
142+
}
143+
139144
if !matches!(ctx.event, EventBox::Time(_)) {
140145
bail!("Trigger is designed to work as a time trigger");
141146
}

0 commit comments

Comments
 (0)