Documentation ¶
Index ¶
- func RandBytes(n int) []byte
- type DummyHeader
- func (d *DummyHeader) ChainID() string
- func (d *DummyHeader) Hash() header.Hash
- func (d *DummyHeader) Height() int64
- func (d *DummyHeader) IsExpired(period time.Duration) bool
- func (d *DummyHeader) IsRecent(blockTime time.Duration) bool
- func (d *DummyHeader) IsZero() bool
- func (d *DummyHeader) LastHeader() header.Hash
- func (d *DummyHeader) MarshalBinary() ([]byte, error)
- func (d *DummyHeader) New() header.Header
- func (d *DummyHeader) Time() time.Time
- func (d *DummyHeader) UnmarshalBinary(data []byte) error
- func (d *DummyHeader) Validate() error
- func (d *DummyHeader) VerifyAdjacent(other header.Header) error
- func (d *DummyHeader) VerifyNonAdjacent(other header.Header) error
- type DummySubscriber
- func (mhs *DummySubscriber) AddValidator(func(context.Context, *DummyHeader) pubsub.ValidationResult) error
- func (mhs *DummySubscriber) Cancel()
- func (mhs *DummySubscriber) NextHeader(ctx context.Context) (*DummyHeader, error)
- func (mhs *DummySubscriber) Stop(context.Context) error
- func (mhs *DummySubscriber) Subscribe() (header.Subscription[*DummyHeader], error)
- type Generator
- type Raw
- type Suite
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DummyHeader ¶
type DummyHeader struct { Raw // contains filtered or unexported fields }
func RandDummyHeader ¶
func RandDummyHeader(t *testing.T) *DummyHeader
func (*DummyHeader) ChainID ¶
func (d *DummyHeader) ChainID() string
func (*DummyHeader) Hash ¶
func (d *DummyHeader) Hash() header.Hash
func (*DummyHeader) Height ¶
func (d *DummyHeader) Height() int64
func (*DummyHeader) IsZero ¶
func (d *DummyHeader) IsZero() bool
func (*DummyHeader) LastHeader ¶
func (d *DummyHeader) LastHeader() header.Hash
func (*DummyHeader) MarshalBinary ¶
func (d *DummyHeader) MarshalBinary() ([]byte, error)
func (*DummyHeader) New ¶
func (d *DummyHeader) New() header.Header
func (*DummyHeader) Time ¶
func (d *DummyHeader) Time() time.Time
func (*DummyHeader) UnmarshalBinary ¶
func (d *DummyHeader) UnmarshalBinary(data []byte) error
func (*DummyHeader) Validate ¶
func (d *DummyHeader) Validate() error
func (*DummyHeader) VerifyAdjacent ¶
func (d *DummyHeader) VerifyAdjacent(other header.Header) error
func (*DummyHeader) VerifyNonAdjacent ¶
func (d *DummyHeader) VerifyNonAdjacent(other header.Header) error
type DummySubscriber ¶
type DummySubscriber struct {
Headers []*DummyHeader
}
func (*DummySubscriber) AddValidator ¶
func (mhs *DummySubscriber) AddValidator(func(context.Context, *DummyHeader) pubsub.ValidationResult) error
func (*DummySubscriber) Cancel ¶
func (mhs *DummySubscriber) Cancel()
func (*DummySubscriber) NextHeader ¶
func (mhs *DummySubscriber) NextHeader(ctx context.Context) (*DummyHeader, error)
func (*DummySubscriber) Subscribe ¶
func (mhs *DummySubscriber) Subscribe() (header.Subscription[*DummyHeader], error)
type Suite ¶
type Suite struct {
// contains filtered or unexported fields
}
Suite provides everything you need to test chain of Headers. If not, please don't hesitate to extend it for your case.
func (*Suite) GenDummyHeaders ¶
func (s *Suite) GenDummyHeaders(num int) []*DummyHeader
func (*Suite) GetRandomHeader ¶
func (s *Suite) GetRandomHeader() *DummyHeader
func (*Suite) Head ¶
func (s *Suite) Head() *DummyHeader
Click to show internal directories.
Click to hide internal directories.