Skip to content

Commit

Permalink
fix to add the height in IBC event
Browse files Browse the repository at this point in the history
  • Loading branch information
yito88 committed Jan 3, 2024
1 parent c4f0b4f commit e9433e3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 4 additions & 1 deletion apps/src/lib/node/ledger/shell/finalize_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,10 @@ where
// Pgf inflation
pgf_inflation::apply_inflation(&mut self.wl_storage)?;
for ibc_event in self.wl_storage.write_log_mut().take_ibc_events() {
let event = Event::from(ibc_event.clone());
let mut event = Event::from(ibc_event.clone());
// Add the height for IBC event query
let height = self.wl_storage.storage.get_last_block_height() + 1;
event["height"] = height.to_string();
response.events.push(event);
}

Expand Down
9 changes: 8 additions & 1 deletion apps/src/lib/node/ledger/shell/governance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,14 @@ where
for ibc_event in
shell.wl_storage.write_log_mut().take_ibc_events()
{
let event = Event::from(ibc_event.clone());
let mut event = Event::from(ibc_event.clone());
// Add the height for IBC event query
let height = shell
.wl_storage
.storage
.get_last_block_height()
+ 1;
event["height"] = height.to_string();
response.events.push(event);
}

Expand Down

0 comments on commit e9433e3

Please sign in to comment.