Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: clarify what is available in ctx.BlockHeader() (backport #23394) #23398

Merged
merged 2 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions types/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ func (c Context) CometInfo() comet.Info { return c.comet
func (c Context) HeaderInfo() header.Info { return c.headerInfo }

// BlockHeader returns the header by value.
// Note, only ChainID, Time and Height are always filled by baseapp.
// In finalize block, the proposer address, validator hash and app hash are also filled.
// Use CometInfo service and/or the Consensus Keeper for getting more information.
func (c Context) BlockHeader() cmtproto.Header {
Comment on lines 92 to 98
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change potentially affects state.

Call sequence:

(github.com/cosmos/cosmos-sdk/types.Context).BlockHeader (types/context.go:95)
(github.com/cosmos/cosmos-sdk/types.Context).WithProposer (types/context.go:183)
(*github.com/cosmos/cosmos-sdk/baseapp.BaseApp).PrepareProposal (types/context.go:408)

return c.header
}
Expand Down
1 change: 1 addition & 0 deletions x/auth/ante/expected_keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@ type FeegrantKeeper interface {
}

type ConsensusKeeper interface {
AppVersion(ctx context.Context) (uint64, error)
BlockParams(context.Context) (uint64, uint64, error)
}
15 changes: 15 additions & 0 deletions x/auth/ante/testutil/expected_keepers_mocks.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading