Skip to content

Commit

Permalink
fix: streaming listeners are not called for deliver tx event (backport
Browse files Browse the repository at this point in the history
…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>
  • Loading branch information
2 people authored and JeancarloBarrios committed Sep 28, 2024
1 parent b919868 commit ce00982
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

* (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`.
* (x/upgrade) [#12906](https://github.com/cosmos/cosmos-sdk/pull/12906) Fix upgrade failure by moving downgrade verification logic after store migration.
* (store) [#13336](https://github.com/cosmos/cosmos-sdk/pull/13336) Call streaming listeners for deliver tx event, it was removed accidentally, backport #13334.

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

Expand Down
11 changes: 4 additions & 7 deletions baseapp/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,20 +317,17 @@ func (app *BaseApp) CheckTx(req abci.RequestCheckTx) abci.ResponseCheckTx {
// Regardless of tx execution outcome, the ResponseDeliverTx will contain relevant
// gas execution context.
func (app *BaseApp) DeliverTx(req abci.RequestDeliverTx) (res abci.ResponseDeliverTx) {
defer telemetry.MeasureSince(time.Now(), "abci", "deliver_tx")
gInfo := sdk.GasInfo{}
resultStr := "successful"

defer func() {
for _, streamingListener := range app.abciListeners {
goCtx := sdk.WrapSDKContext(app.deliverState.ctx)
if err := streamingListener.ListenDeliverTx(goCtx, req, res); err != nil {
panic(fmt.Errorf("DeliverTx listening hook failed: %w", err))
if err := streamingListener.ListenDeliverTx(app.deliverState.ctx, req, res); err != nil {
app.logger.Error("DeliverTx listening hook failed", "err", err)
}
}
}()

gInfo := sdk.GasInfo{}
resultStr := "successful"

defer func() {
telemetry.IncrCounter(1, "tx", "count")
telemetry.IncrCounter(1, "tx", resultStr)
Expand Down

0 comments on commit ce00982

Please sign in to comment.