mocks

package
v0.6.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 18, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockStore

type MockStore struct {
	Headers    map[int64]*header.ExtendedHeader
	HeadHeight int64
}

func NewStore

func NewStore(t *testing.T, numHeaders int) *MockStore

NewStore creates a mock store and adds several random headers

func (*MockStore) Append

func (m *MockStore) Append(ctx context.Context, headers ...*header.ExtendedHeader) (int, error)

func (*MockStore) Get

func (*MockStore) GetByHeight

func (m *MockStore) GetByHeight(ctx context.Context, height uint64) (*header.ExtendedHeader, error)

func (*MockStore) GetRangeByHeight

func (m *MockStore) GetRangeByHeight(ctx context.Context, from, to uint64) ([]*header.ExtendedHeader, error)

func (*MockStore) GetVerifiedRange

func (m *MockStore) GetVerifiedRange(
	ctx context.Context,
	h *header.ExtendedHeader,
	to uint64,
) ([]*header.ExtendedHeader, error)

func (*MockStore) Has

func (*MockStore) Head

func (*MockStore) Height

func (m *MockStore) Height() uint64

func (*MockStore) Init

func (*MockStore) Start

func (m *MockStore) Start(context.Context) error

func (*MockStore) Stop

func (m *MockStore) Stop(context.Context) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL