From 05b5a4eb71a6086d0fbe30fab695ac20e9fa7c09 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 19 Dec 2024 21:59:32 +0100 Subject: [PATCH] fix(baseapp): fulfil all header.Info fields in test helpers context (backport #23014) (#23016) Co-authored-by: Damian Nolan --- baseapp/test_helpers.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/baseapp/test_helpers.go b/baseapp/test_helpers.go index cffc2589f0..1cb71825bc 100644 --- a/baseapp/test_helpers.go +++ b/baseapp/test_helpers.go @@ -2,6 +2,7 @@ package baseapp import ( cmtproto "github.com/cometbft/cometbft/api/cometbft/types/v1" + cmttypes "github.com/cometbft/cometbft/types" coreheader "cosmossdk.io/core/header" errorsmod "cosmossdk.io/errors" @@ -64,11 +65,15 @@ func (app *BaseApp) NewContext(isCheckTx bool) sdk.Context { } func (app *BaseApp) NewUncachedContext(isCheckTx bool, header cmtproto.Header) sdk.Context { + cmtHeader, _ := cmttypes.HeaderFromProto(&header) return sdk.NewContext(app.cms, isCheckTx, app.logger). WithBlockHeader(header). WithHeaderInfo(coreheader.Info{ - Height: header.Height, - Time: header.Time, + AppHash: cmtHeader.AppHash, + Hash: cmtHeader.Hash(), + ChainID: cmtHeader.ChainID, + Height: cmtHeader.Height, + Time: cmtHeader.Time, }) }