activitystreak

package
v0.75.8 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ActivityStreakKey = (&types.PayloadActivityStreak{}).Key()

Functions

This section is empty.

Types

type Broker

type Broker interface {
	SendBatch(evt []events.Event)
}

type Engine

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

func New

func New(
	log *logging.Logger,
	marketStats MarketsStatsAggregator,
	broker Broker,
) *Engine

func (*Engine) GetRewardsDistributionMultiplier

func (e *Engine) GetRewardsDistributionMultiplier(party string) num.Decimal

func (*Engine) GetRewardsVestingMultiplier

func (e *Engine) GetRewardsVestingMultiplier(party string) num.Decimal

func (*Engine) OnBenefitTiersUpdate

func (e *Engine) OnBenefitTiersUpdate(
	_ context.Context, v interface{},
) error

func (*Engine) OnEpochEvent

func (e *Engine) OnEpochEvent(ctx context.Context, epoch types.Epoch)

func (*Engine) OnEpochRestore

func (e *Engine) OnEpochRestore(ctx context.Context, epoch types.Epoch)

func (*Engine) OnMinQuantumOpenNationalVolumeUpdate

func (e *Engine) OnMinQuantumOpenNationalVolumeUpdate(
	_ context.Context, v *num.Uint,
) error

func (*Engine) OnMinQuantumTradeVolumeUpdate

func (e *Engine) OnMinQuantumTradeVolumeUpdate(
	_ context.Context, v *num.Uint,
) error

func (*Engine) OnRewardsActivityStreakInactivityLimit

func (e *Engine) OnRewardsActivityStreakInactivityLimit(
	_ context.Context, v *num.Uint,
) error

type MarketsStatsAggregator

type MarketsStatsAggregator interface {
	GetMarketStats() map[string]*types.MarketStats
}

type PartyActivity

type PartyActivity struct {
	Active                               uint64
	Inactive                             uint64
	RewardDistributionActivityMultiplier num.Decimal
	RewardVestingActivityMultiplier      num.Decimal
}

func (PartyActivity) IsActive

func (p PartyActivity) IsActive() bool

func (*PartyActivity) ResetMultipliers

func (p *PartyActivity) ResetMultipliers()

func (*PartyActivity) UpdateMultipliers

func (p *PartyActivity) UpdateMultipliers(benefitTiers []*types.ActivityStreakBenefitTier)

type SnapshotEngine

type SnapshotEngine struct {
	*Engine
}

func NewSnapshotEngine

func NewSnapshotEngine(
	log *logging.Logger,
	marketStats MarketsStatsAggregator,
	broker Broker,
) *SnapshotEngine

func (*SnapshotEngine) GetState

func (e *SnapshotEngine) GetState(k string) ([]byte, []types.StateProvider, error)

func (*SnapshotEngine) Keys

func (e *SnapshotEngine) Keys() []string

func (*SnapshotEngine) LoadState

func (*SnapshotEngine) Namespace

func (e *SnapshotEngine) Namespace() types.SnapshotNamespace

func (*SnapshotEngine) Stopped

func (e *SnapshotEngine) Stopped() bool

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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