diff --git a/baseapp/abci.go b/baseapp/abci.go index 707f55f4cb..a5e1e5f9c5 100644 --- a/baseapp/abci.go +++ b/baseapp/abci.go @@ -201,10 +201,7 @@ func (app *BaseApp) BeginBlock(req abci.RequestBeginBlock) (res abci.ResponseBeg // call the hooks with the BeginBlock messages for _, streamingListener := range app.abciListeners { - - goCtx := sdk.WrapSDKContext(app.deliverState.ctx) - - if err := streamingListener.ListenBeginBlock(goCtx, req, res); err != nil { + if err := streamingListener.ListenBeginBlock(app.deliverState.ctx, req, res); err != nil { app.logger.Error("BeginBlock listening hook failed", "height", req.Header.Height, "err", err) } } @@ -229,9 +226,7 @@ func (app *BaseApp) EndBlock(req abci.RequestEndBlock) (res abci.ResponseEndBloc // call the streaming service hooks with the EndBlock messages for _, streamingListener := range app.abciListeners { - goCtx := sdk.WrapSDKContext(app.deliverState.ctx) - - if err := streamingListener.ListenEndBlock(goCtx, req, res); err != nil { + if err := streamingListener.ListenEndBlock(app.deliverState.ctx, req, res); err != nil { app.logger.Error("EndBlock listening hook failed", "height", req.Height, "err", err) } } @@ -334,9 +329,7 @@ func (app *BaseApp) DeliverTx(req abci.RequestDeliverTx) (res abci.ResponseDeliv defer func() { for _, streamingListener := range app.abciListeners { - goCtx := sdk.WrapSDKContext(app.deliverState.ctx) - - if err := streamingListener.ListenDeliverTx(goCtx, req, res); err != nil { + if err := streamingListener.ListenDeliverTx(app.deliverState.ctx, req, res); err != nil { app.logger.Error("DeliverTx listening hook failed", "err", err) } } diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index ca1fbed2a5..dab3de1e3c 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -357,11 +357,11 @@ func (app *BaseApp) Init() error { app.setProcessProposalState(emptyHeader) app.Seal() -if app.cms == nil { - return errors.New("commit multi-store must not be nil") -} + if app.cms == nil { + return errors.New("commit multi-store must not be nil") + } -return app.cms.GetPruning().Validate() + return app.cms.GetPruning().Validate() } func (app *BaseApp) setMinGasPrices(gasPrices sdk.DecCoins) { diff --git a/types/context.go b/types/context.go index 1469135f3e..fac8ed981b 100644 --- a/types/context.go +++ b/types/context.go @@ -314,6 +314,8 @@ const SdkContextKey ContextKey = "sdk-context" // context as a value. It is useful for passing an sdk.Context through methods that take a // stdlib context.Context parameter such as generated gRPC methods. To get the original // sdk.Context back, call UnwrapSDKContext. +// +// Deprecated: there is no need to wrap anymore as the Cosmos SDK context implements context.Context. func WrapSDKContext(ctx Context) context.Context { return ctx }