Skip to content

Commit a886d9b

Browse files
committed
fix(baseapp) fulfill all header.Info fields in test helpers context
1 parent 69025c5 commit a886d9b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

baseapp/test_helpers.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package baseapp
22

33
import (
44
cmtproto "github.com/cometbft/cometbft/api/cometbft/types/v1"
5+
cmttypes "github.com/cometbft/cometbft/types"
56

67
coreheader "cosmossdk.io/core/header"
78
errorsmod "cosmossdk.io/errors"
@@ -64,11 +65,15 @@ func (app *BaseApp) NewContext(isCheckTx bool) sdk.Context {
6465
}
6566

6667
func (app *BaseApp) NewUncachedContext(isCheckTx bool, header cmtproto.Header) sdk.Context {
68+
cmtHeader, _ := cmttypes.HeaderFromProto(&header)
6769
return sdk.NewContext(app.cms, isCheckTx, app.logger).
6870
WithBlockHeader(header).
6971
WithHeaderInfo(coreheader.Info{
70-
Height: header.Height,
71-
Time: header.Time,
72+
AppHash: cmtHeader.AppHash,
73+
Hash: cmtHeader.Hash(),
74+
ChainID: cmtHeader.ChainID,
75+
Height: cmtHeader.Height,
76+
Time: cmtHeader.Time,
7277
})
7378
}
7479

0 commit comments

Comments
 (0)