Skip to content

Commit

Permalink
Merge branch 'tomas/clear-ibc-events' (#2850)
Browse files Browse the repository at this point in the history
* origin/tomas/clear-ibc-events:
  changelog: add #2850
  state/write_log: clear IBC events in `fn drop_tx`
  • Loading branch information
brentstone committed Mar 18, 2024
2 parents 28b512f + 49a6bd8 commit bee672a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .changelog/unreleased/bug-fixes/2850-clear-ibc-events.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Clear IBC events emitted from rejected txs.
([\#2850](https://github.com/anoma/namada/pull/2850))
7 changes: 4 additions & 3 deletions crates/state/src/write_log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -473,12 +473,13 @@ impl WriteLog {
self.take_ibc_events();
}

/// Drop the current transaction's write log and precommit when it's
/// declined by any of the triggered validity predicates. Starts a new
/// transaction write log.
/// Drop the current transaction's write log and IBC events and precommit
/// when it's declined by any of the triggered validity predicates.
/// Starts a new transaction write log.
pub fn drop_tx(&mut self) {
self.tx_precommit_write_log.clear();
self.tx_write_log.clear();
self.ibc_events.clear();
}

/// Drop the current transaction's write log but keep the precommit one.
Expand Down

0 comments on commit bee672a

Please sign in to comment.