consensus

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: Apache-2.0, MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeEC

type FakeEC struct {
	// contains filtered or unexported fields
}

func NewFakeEC

func NewFakeEC(ctx context.Context, options ...FakeECOption) *FakeEC

func (*FakeEC) Finalize

func (ec *FakeEC) Finalize(context.Context, gpbft.TipSetKey) error

func (*FakeEC) GetCurrentHead

func (ec *FakeEC) GetCurrentHead() int64

func (*FakeEC) GetHead

func (ec *FakeEC) GetHead(ctx context.Context) (ec.TipSet, error)

func (*FakeEC) GetParent

func (ec *FakeEC) GetParent(ctx context.Context, ts ec.TipSet) (ec.TipSet, error)

func (*FakeEC) GetPowerTable

func (ec *FakeEC) GetPowerTable(_ context.Context, tsk gpbft.TipSetKey) (gpbft.PowerEntries, error)

func (*FakeEC) GetTipset

func (ec *FakeEC) GetTipset(_ context.Context, tsk gpbft.TipSetKey) (ec.TipSet, error)

func (*FakeEC) GetTipsetByEpoch

func (ec *FakeEC) GetTipsetByEpoch(_ context.Context, epoch int64) (ec.TipSet, error)

GetTipsetByEpoch returns the tipset at a given epoch. If the epoch does not yet exist, it returns an error.

func (*FakeEC) Pause

func (ec *FakeEC) Pause()

Pause pauses EC.

func (*FakeEC) Resume

func (ec *FakeEC) Resume()

Resume resumes EC.

type FakeECOption added in v0.4.0

type FakeECOption func(*fakeECConfig)

func WithBootstrapEpoch added in v0.4.0

func WithBootstrapEpoch(epoch int64) FakeECOption

func WithECPeriod added in v0.4.0

func WithECPeriod(ecPeriod time.Duration) FakeECOption

func WithEvolvingPowerTable added in v0.4.0

func WithEvolvingPowerTable(fn PowerTableMutator) FakeECOption

func WithInitialPowerTable added in v0.4.0

func WithInitialPowerTable(initialPowerTable gpbft.PowerEntries) FakeECOption

func WithMaxLookback added in v0.4.0

func WithMaxLookback(distance int64) FakeECOption

func WithSeed added in v0.4.0

func WithSeed(seed uint64) FakeECOption

type PowerTableMutator added in v0.4.0

type PowerTableMutator func(epoch int64, pt gpbft.PowerEntries) gpbft.PowerEntries

Jump to

Keyboard shortcuts

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