docs: clarify what is available in ctx.BlockHeader() (#23394)
This commit is contained in:
parent
69defb4011
commit
bbf813ccda
@ -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 {
|
||||
return c.header
|
||||
}
|
||||
|
||||
@ -28,5 +28,6 @@ type FeegrantKeeper interface {
|
||||
}
|
||||
|
||||
type ConsensusKeeper interface {
|
||||
AppVersion(ctx context.Context) (uint64, error)
|
||||
BlockParams(context.Context) (uint64, uint64, error)
|
||||
}
|
||||
|
||||
@ -202,6 +202,21 @@ func (m *MockConsensusKeeper) EXPECT() *MockConsensusKeeperMockRecorder {
|
||||
return m.recorder
|
||||
}
|
||||
|
||||
// AppVersion mocks base method.
|
||||
func (m *MockConsensusKeeper) AppVersion(ctx context.Context) (uint64, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "AppVersion", ctx)
|
||||
ret0, _ := ret[0].(uint64)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// AppVersion indicates an expected call of AppVersion.
|
||||
func (mr *MockConsensusKeeperMockRecorder) AppVersion(ctx any) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AppVersion", reflect.TypeOf((*MockConsensusKeeper)(nil).AppVersion), ctx)
|
||||
}
|
||||
|
||||
// BlockParams mocks base method.
|
||||
func (m *MockConsensusKeeper) BlockParams(arg0 context.Context) (uint64, uint64, error) {
|
||||
m.ctrl.T.Helper()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user