Documentation ¶
Index ¶
- Variables
- type ActivityStreakVestingMultiplier
- type Assets
- type Broker
- type Collateral
- type Config
- type Engine
- func (e *Engine) AddReward(ctx context.Context, party, asset string, amount *num.Uint, ...)
- func (e *Engine) GetSingleAndSummedRewardBonusMultipliers(party string) (MultiplierAndQuantBalance, MultiplierAndQuantBalance)
- func (e *Engine) OnBenefitTiersUpdate(_ context.Context, v interface{}) error
- func (e *Engine) OnCheckpointLoaded()
- func (e *Engine) OnEpochEvent(ctx context.Context, epoch types.Epoch)
- func (e *Engine) OnEpochRestore(_ context.Context, epoch types.Epoch)
- func (e *Engine) OnRewardVestingBaseRateUpdate(_ context.Context, baseRate num.Decimal) error
- func (e *Engine) OnRewardVestingMinimumTransferUpdate(_ context.Context, minimumTransfer num.Decimal) error
- func (e *Engine) OnStakingAssetUpdate(_ context.Context, stakingAsset string) error
- func (e *Engine) OnTick(ctx context.Context, _ time.Time)
- type MultiplierAndQuantBalance
- type Parties
- type PartyRewards
- type SnapshotEngine
- func (e *SnapshotEngine) GetState(k string) ([]byte, []types.StateProvider, error)
- func (e *SnapshotEngine) Keys() []string
- func (e *SnapshotEngine) LoadState(ctx context.Context, p *types.Payload) ([]types.StateProvider, error)
- func (e *SnapshotEngine) Namespace() types.SnapshotNamespace
- func (e *SnapshotEngine) Stopped() bool
- type StakeAccounting
- type Time
Constants ¶
This section is empty.
Variables ¶
View Source
var VestingKey = (&types.PayloadVesting{}).Key()
Functions ¶
This section is empty.
Types ¶
type Collateral ¶
type Collateral interface { TransferVestedRewards(ctx context.Context, transfers []*types.Transfer) ([]*types.LedgerMovement, error) GetVestingRecovery() map[string]map[string]*num.Uint GetAllVestingQuantumBalance(party string) num.Decimal GetAllVestingAndVestedAccountForAsset(asset string) []*types.Account }
type Config ¶
func NewDefaultConfig ¶
func NewDefaultConfig() Config
NewDefaultConfig creates an instance of the package specific configuration.
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func New ¶
func New( log *logging.Logger, c Collateral, asvm ActivityStreakVestingMultiplier, broker Broker, assets Assets, parties Parties, t Time, stakeAccounting StakeAccounting, ) *Engine
func (*Engine) GetSingleAndSummedRewardBonusMultipliers ¶ added in v0.77.0
func (e *Engine) GetSingleAndSummedRewardBonusMultipliers(party string) (MultiplierAndQuantBalance, MultiplierAndQuantBalance)
GetSingleAndSummedRewardBonusMultipliers returns a single and summed reward bonus multipliers and quantum balances for a party. The single multiplier is calculated based on the quantum balance of the party. The summed multiplier is calculated based on the quantum balance of the party and all derived keys. Caches the summed multiplier and quantum balance for the party.
func (*Engine) OnBenefitTiersUpdate ¶
func (*Engine) OnCheckpointLoaded ¶
func (e *Engine) OnCheckpointLoaded()
func (*Engine) OnEpochRestore ¶
func (*Engine) OnRewardVestingBaseRateUpdate ¶
func (*Engine) OnRewardVestingMinimumTransferUpdate ¶
func (*Engine) OnStakingAssetUpdate ¶ added in v0.79.0
type MultiplierAndQuantBalance ¶ added in v0.77.0
type PartyRewards ¶
type PartyRewards struct { // the amounts per assets still being locked in the // account and not available to be released // this is a map of: // asset -> (remainingEpochLock -> Amount) Locked map[string]map[uint64]*num.Uint // the current part of the vesting account // per asset available for vesting Vesting map[string]*num.Uint }
type SnapshotEngine ¶
type SnapshotEngine struct {
*Engine
}
func NewSnapshotEngine ¶
func NewSnapshotEngine( log *logging.Logger, c Collateral, asvm ActivityStreakVestingMultiplier, broker Broker, assets Assets, parties Parties, t Time, stakeAccounting StakeAccounting, ) *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 (e *SnapshotEngine) LoadState(ctx context.Context, p *types.Payload) ([]types.StateProvider, error)
func (*SnapshotEngine) Namespace ¶
func (e *SnapshotEngine) Namespace() types.SnapshotNamespace
func (*SnapshotEngine) Stopped ¶
func (e *SnapshotEngine) Stopped() bool
type StakeAccounting ¶ added in v0.79.0
type StakeAccounting interface {
AddEvent(ctx context.Context, evt *types.StakeLinking)
}
Click to show internal directories.
Click to hide internal directories.