Documentation
¶
Index ¶
- type FakeEC
- func (ec *FakeEC) Finalize(_ context.Context, tsk gpbft.TipSetKey) error
- func (ec *FakeEC) GetCurrentHead() int64
- func (ec *FakeEC) GetHead(ctx context.Context) (ec.TipSet, error)
- func (ec *FakeEC) GetParent(ctx context.Context, ts ec.TipSet) (ec.TipSet, error)
- func (ec *FakeEC) GetPowerTable(_ context.Context, tsk gpbft.TipSetKey) (gpbft.PowerEntries, error)
- func (ec *FakeEC) GetTipset(_ context.Context, tsk gpbft.TipSetKey) (ec.TipSet, error)
- func (ec *FakeEC) GetTipsetByEpoch(_ context.Context, epoch int64) (ec.TipSet, error)
- func (ec *FakeEC) Pause()
- func (ec *FakeEC) Resume()
- type FakeECOption
- func WithBootstrapEpoch(epoch int64) FakeECOption
- func WithClock(clock clock.Clock) FakeECOption
- func WithECPeriod(ecPeriod time.Duration) FakeECOption
- func WithEvolvingPowerTable(fn PowerTableMutator) FakeECOption
- func WithForkAfterEpochs(e int64) FakeECOption
- func WithForkSeed(e int64) FakeECOption
- func WithInitialPowerTable(initialPowerTable gpbft.PowerEntries) FakeECOption
- func WithMaxLookback(distance int64) FakeECOption
- func WithNullTipsetProbability(p float64) FakeECOption
- func WithSeed(seed int64) FakeECOption
- type PowerTableMutator
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(o ...FakeECOption) *FakeEC
func (*FakeEC) GetCurrentHead ¶
func (*FakeEC) GetPowerTable ¶
func (*FakeEC) GetTipsetByEpoch ¶
GetTipsetByEpoch returns the tipset at a given epoch. If the epoch does not yet exist, it returns an error.
type FakeECOption ¶ added in v0.4.0
type FakeECOption func(*fakeECOptions)
func WithBootstrapEpoch ¶ added in v0.4.0
func WithBootstrapEpoch(epoch int64) FakeECOption
func WithClock ¶ added in v0.8.5
func WithClock(clock clock.Clock) FakeECOption
WithClock sets the clock used to determine the current time. This is useful for testing purposes, as it allows you to control the time progression of the EC. The default clock is the system clock.
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 WithForkAfterEpochs ¶ added in v0.8.4
func WithForkAfterEpochs(e int64) FakeECOption
WithForkAfterEpochs sets the minimum number of epochs from the latest finalized tipset key after which this EC may fork away.
func WithForkSeed ¶ added in v0.8.4
func WithForkSeed(e int64) FakeECOption
WithForkSeed sets the seed used to generate fork chains. For this option to take effect, WithForkAfterEpochs must be set to a value greater than 0.
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 WithNullTipsetProbability ¶ added in v0.8.5
func WithNullTipsetProbability(p float64) FakeECOption
func WithSeed ¶ added in v0.4.0
func WithSeed(seed int64) FakeECOption
type PowerTableMutator ¶ added in v0.4.0
type PowerTableMutator func(epoch int64, pt gpbft.PowerEntries) gpbft.PowerEntries
Click to show internal directories.
Click to hide internal directories.