Skip to content

Commit 6c8614c

Browse files
mergify[bot]yihuang
andauthored
fix: streaming listeners are not called for deliver tx event (backport cosmos#13334) (cosmos#13336)
* fix: streaming listeners are not called for deliver tx event (cosmos#13334) * Problem: streaming listeners are not called for deliver tx event it was removed accidentally, add back. * Update CHANGELOG.md * try to fix e2e test by wait for one more block (cherry picked from commit 822900b) # Conflicts: # CHANGELOG.md # x/auth/tx/service_test.go * Update CHANGELOG.md * Update x/auth/tx/service_test.go * Update x/auth/tx/service_test.go Co-authored-by: yihuang <huang@crypto.com>
1 parent 100db2e commit 6c8614c

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
8080

8181
* (x/group) [#12888](https://github.com/cosmos/cosmos-sdk/pull/12888) Fix event propagation to the current context of `x/group` message execution `[]sdk.Result`.
8282
* (x/upgrade) [#12906](https://github.com/cosmos/cosmos-sdk/pull/12906) Fix upgrade failure by moving downgrade verification logic after store migration.
83+
* (store) [#13336](https://github.com/cosmos/cosmos-sdk/pull/13336) Call streaming listeners for deliver tx event, it was removed accidentally, backport #13334.
8384

8485
## [v0.46.0](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.0) - 2022-07-26
8586

baseapp/abci.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,18 @@ func (app *BaseApp) CheckTx(req abci.RequestCheckTx) abci.ResponseCheckTx {
278278
// Otherwise, the ResponseDeliverTx will contain releveant error information.
279279
// Regardless of tx execution outcome, the ResponseDeliverTx will contain relevant
280280
// gas execution context.
281-
func (app *BaseApp) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDeliverTx {
281+
func (app *BaseApp) DeliverTx(req abci.RequestDeliverTx) (res abci.ResponseDeliverTx) {
282282
gInfo := sdk.GasInfo{}
283283
resultStr := "successful"
284284

285+
defer func() {
286+
for _, streamingListener := range app.abciListeners {
287+
if err := streamingListener.ListenDeliverTx(app.deliverState.ctx, req, res); err != nil {
288+
app.logger.Error("DeliverTx listening hook failed", "err", err)
289+
}
290+
}
291+
}()
292+
285293
defer func() {
286294
telemetry.IncrCounter(1, "tx", "count")
287295
telemetry.IncrCounter(1, "tx", resultStr)

0 commit comments

Comments
 (0)