local

package
v0.7.0-rc6 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewExchange

func NewExchange[H header.Header](store header.Store[H]) header.Exchange[H]

NewExchange creates a new local Exchange.

Types

type Exchange

type Exchange[H header.Header] struct {
	// contains filtered or unexported fields
}

Exchange is a simple Exchange that reads Headers from Store without any networking.

func (*Exchange[H]) Get

func (l *Exchange[H]) Get(ctx context.Context, hash header.Hash) (H, error)

func (*Exchange[H]) GetByHeight

func (l *Exchange[H]) GetByHeight(ctx context.Context, height uint64) (H, error)

func (*Exchange[H]) GetRangeByHeight

func (l *Exchange[H]) GetRangeByHeight(ctx context.Context, origin, amount uint64) ([]H, error)

func (*Exchange[H]) GetVerifiedRange

func (l *Exchange[H]) GetVerifiedRange(ctx context.Context, from H, amount uint64,
) ([]H, error)

func (*Exchange[H]) Head

func (l *Exchange[H]) Head(ctx context.Context) (H, error)

func (*Exchange[H]) Start

func (l *Exchange[H]) Start(context.Context) error

func (*Exchange[H]) Stop

func (l *Exchange[H]) Stop(context.Context) error

Jump to

Keyboard shortcuts

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