fix: Set headerInfo in context on setState (#19338)
This commit is contained in:
+13
-3
@@ -17,6 +17,7 @@ import (
|
||||
"golang.org/x/exp/maps"
|
||||
protov2 "google.golang.org/protobuf/proto"
|
||||
|
||||
"cosmossdk.io/core/header"
|
||||
errorsmod "cosmossdk.io/errors"
|
||||
"cosmossdk.io/log"
|
||||
"cosmossdk.io/store"
|
||||
@@ -479,11 +480,20 @@ func (app *BaseApp) IsSealed() bool { return app.sealed }
|
||||
// setState sets the BaseApp's state for the corresponding mode with a branched
|
||||
// multi-store (i.e. a CacheMultiStore) and a new Context with the same
|
||||
// multi-store branch, and provided header.
|
||||
func (app *BaseApp) setState(mode execMode, header cmtproto.Header) {
|
||||
func (app *BaseApp) setState(mode execMode, h cmtproto.Header) {
|
||||
ms := app.cms.CacheMultiStore()
|
||||
headerInfo := header.Info{
|
||||
Height: h.Height,
|
||||
Time: h.Time,
|
||||
ChainID: h.ChainID,
|
||||
AppHash: h.AppHash,
|
||||
}
|
||||
baseState := &state{
|
||||
ms: ms,
|
||||
ctx: sdk.NewContext(ms, false, app.logger).WithStreamingManager(app.streamingManager).WithBlockHeader(header),
|
||||
ms: ms,
|
||||
ctx: sdk.NewContext(ms, false, app.logger).
|
||||
WithStreamingManager(app.streamingManager).
|
||||
WithBlockHeader(h).
|
||||
WithHeaderInfo(headerInfo),
|
||||
}
|
||||
|
||||
switch mode {
|
||||
|
||||
Reference in New Issue
Block a user