Documentation ¶
Index ¶
- func ExtendedHeaderFromEDS(t *testing.T, height uint64, eds *rsmt2d.ExtendedDataSquare) *header.ExtendedHeader
- func MakeCommit(blockID types.BlockID, height int64, round int32, voteSet *types.VoteSet, ...) (*types.Commit, error)
- func NewCustomStore(t *testing.T, generator headertest.Generator[*header.ExtendedHeader], ...) libhead.Store[*header.ExtendedHeader]
- func NewStore(t *testing.T) libhead.Store[*header.ExtendedHeader]
- func RandBlockID(testing.TB) types.BlockID
- func RandExtendedHeader(t testing.TB) *header.ExtendedHeader
- func RandExtendedHeaderAtTimestamp(t testing.TB, timestamp time.Time) *header.ExtendedHeader
- func RandExtendedHeaderWithRoot(t testing.TB, dah *da.DataAvailabilityHeader) *header.ExtendedHeader
- func RandRawHeader(t testing.TB) *header.RawHeader
- func RandValidator(randPower bool, minPower int64) (*types.Validator, types.PrivValidator)
- func RandValidatorSet(numValidators int, votingPower int64) (*types.ValidatorSet, []types.PrivValidator)
- type Subscriber
- type TestSuite
- func (s *TestSuite) Commit(h *header.RawHeader) *types.Commit
- func (s *TestSuite) GenExtendedHeaders(num int) []*header.ExtendedHeader
- func (s *TestSuite) GenRawHeader(height uint64, lastHeader, lastCommit, dataHash libhead.Hash) *header.RawHeader
- func (s *TestSuite) Head() *header.ExtendedHeader
- func (s *TestSuite) NextHeader() *header.ExtendedHeader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtendedHeaderFromEDS ¶ added in v0.11.0
func ExtendedHeaderFromEDS(t *testing.T, height uint64, eds *rsmt2d.ExtendedDataSquare) *header.ExtendedHeader
func MakeCommit ¶
func NewCustomStore ¶ added in v0.14.0
func NewCustomStore( t *testing.T, generator headertest.Generator[*header.ExtendedHeader], numHeaders int, ) libhead.Store[*header.ExtendedHeader]
func RandBlockID ¶
RandBlockID provides a BlockID fixture.
func RandExtendedHeader ¶
func RandExtendedHeader(t testing.TB) *header.ExtendedHeader
RandExtendedHeader provides an ExtendedHeader fixture.
func RandExtendedHeaderAtTimestamp ¶ added in v0.14.0
func RandExtendedHeaderWithRoot ¶ added in v0.11.0
func RandExtendedHeaderWithRoot(t testing.TB, dah *da.DataAvailabilityHeader) *header.ExtendedHeader
func RandRawHeader ¶
RandRawHeader provides a RawHeader fixture.
func RandValidator ¶
func RandValidatorSet ¶
func RandValidatorSet(numValidators int, votingPower int64) (*types.ValidatorSet, []types.PrivValidator)
Types ¶
type Subscriber ¶ added in v0.9.0
type Subscriber struct { headertest.Subscriber[*header.ExtendedHeader] }
type TestSuite ¶
type TestSuite struct {
// contains filtered or unexported fields
}
TestSuite provides everything you need to test chain of Headers. If not, please don't hesitate to extend it for your case.
func NewTestSuite ¶
NewTestSuite setups a new test suite with a given number of validators.
func (*TestSuite) GenExtendedHeaders ¶
func (s *TestSuite) GenExtendedHeaders(num int) []*header.ExtendedHeader
func (*TestSuite) GenRawHeader ¶
func (*TestSuite) Head ¶
func (s *TestSuite) Head() *header.ExtendedHeader
func (*TestSuite) NextHeader ¶ added in v0.9.0
func (s *TestSuite) NextHeader() *header.ExtendedHeader
Click to show internal directories.
Click to hide internal directories.