Documentation ¶
Index ¶
- Constants
- func ChangeTeamActive(aag *types.ActiveAggregations, teamSize uint64, delta int64)
- func NewMsgServer(keeper Keeper) types.MsgServer
- type Hooks
- func (h Hooks) CheckDelegationAvailable(ctx context.Context, delAddr, valAddr string) error
- func (h Hooks) DelegationCoinsModified(ctx context.Context, delAddr, valAddr string, oldCoins, newCoins math.Int) error
- func (h Hooks) SpendCoinsForRef(ctx context.Context, addr string, totalAmount math.Int) (math.Int, error)
- type Keeper
- func (k *Keeper) AddHook(eventName string, callback func(ctx sdk.Context, acc sdk.AccAddress) error)
- func (k Keeper) AddTopLevelAccount(ctx sdk.Context, acc string, status types.Status) (err error)
- func (k Keeper) AppendChild(ctx sdk.Context, parentAcc string, childAcc string) error
- func (k Keeper) AreStatusRequirementsFulfilled(ctx sdk.Context, acc string, s types.Status) (types.StatusCheckResult, error)
- func (k Keeper) BurnCoins(ctx sdk.Context, acc sdk.AccAddress, amt sdk.Coins) error
- func (k Keeper) ExportToGenesis(ctx sdk.Context) (*types.GenesisState, error)
- func (k Keeper) Get(ctx sdk.Context, acc string) (types.Info, error)
- func (k Keeper) GetChildren(ctx sdk.Context, acc string) (children []string, err error)
- func (k Keeper) GetDelegatedInNetwork(ctx sdk.Context, acc string) (math.Int, error)
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetParent(ctx sdk.Context, acc string) (string, error)
- func (k Keeper) GetReferralFeesForDelegating(ctx sdk.Context, acc string) ([]types.ReferralFee, util.Fraction, error)
- func (k Keeper) GetStatus(ctx sdk.Context, acc string) (types.Status, error)
- func (k Keeper) GetTopLevelAccounts(ctx sdk.Context) (topLevel []string, err error)
- func (k Keeper) Hooks() Hooks
- func (k Keeper) ImportFromGenesis(ctx sdk.Context, topLevel []*types.RefInfo, otherAccounts []types.Refs, ...) error
- func (k Keeper) Iterate(ctx sdk.Context, ...)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MustSetActive(ctx sdk.Context, acc string, value bool, bu *bunchUpdater)
- func (k Keeper) MustSetActiveWithoutStatusUpdate(ctx sdk.Context, acc string, value bool, bu *bunchUpdater)
- func (k Keeper) OnBalanceChanged(ctx sdk.Context, acc string, dd math.Int) error
- func (k Keeper) OneDay(ctx sdk.Context) time.Duration
- func (k Keeper) OneMonth(ctx sdk.Context) time.Duration
- func (k Keeper) OneWeek(ctx sdk.Context) time.Duration
- func (k Keeper) PayUpFees(ctx sdk.Context, acc string, totalAmount math.Int) (remain math.Int, err error)
- func (k Keeper) PerfomStatusDowngradeSchedule(ctx sdk.Context) error
- func (k Keeper) PerformDowngrade(ctx sdk.Context, data []byte, _ time.Time)
- func (k Keeper) PerformStatusBonus(ctx sdk.Context, _ []byte, t time.Time)
- func (k Keeper) RemoveStatusDowngradeSchedule(ctx sdk.Context, acc string, downgradeAt time.Time) error
- func (k Keeper) ScheduleStatusDowngrade(ctx sdk.Context, acc string, downgradeAt time.Time) error
- func (k Keeper) SetActive(ctx sdk.Context, acc string, value, checkAncestorsForStatusUpdate bool, ...) error
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- type Querier
- func (qs Querier) CheckStatus(ctx context.Context, request *types.CheckStatusRequest) (*types.CheckStatusResponse, error)
- func (qs Querier) Children(ctx context.Context, request *types.ChildrenRequest) (*types.ChildrenResponse, error)
- func (qs Querier) Coins(ctx context.Context, request *types.CoinsRequest) (*types.CoinsResponse, error)
- func (qs Querier) Exists(ctx context.Context, request *types.ExistsRequest) (*types.ExistsResponse, error)
- func (qs Querier) Get(ctx context.Context, request *types.GetRequest) (*types.GetResponse, error)
- func (qs Querier) Params(ctx context.Context, _ *types.ParamsRequest) (*types.ParamsResponse, error)
Constants ¶
const ( StatusUpdatedCallback = "status-updated" StakeChangedCallback = "stake-changed" )
const ( StatusGuruMinXCriteria = 3 StatusGuruMinXParameter StatusLeaderMinXCriteria )
Variables ¶
This section is empty.
Functions ¶
func ChangeTeamActive ¶ added in v1.0.2
func ChangeTeamActive(aag *types.ActiveAggregations, teamSize uint64, delta int64)
func NewMsgServer ¶
Types ¶
type Hooks ¶
type Hooks struct {
// contains filtered or unexported fields
}
Wrapper struct
func (Hooks) CheckDelegationAvailable ¶
type Keeper ¶
type Keeper struct { Params collections.Item[types.Params] // contains filtered or unexported fields }
Keeper of the referral store
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeService storetypes.KVStoreService, accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, stakingKeeper types.StakingKeeper, authority sdk.AccAddress, referralAccountName string, ) *Keeper
NewKeeper creates a referral keeper
func (Keeper) AddTopLevelAccount ¶
AddTopLevelAccount adds accounts without parent and is supposed to be used during genesis
func (Keeper) AppendChild ¶
AppendChild adds a new account to the referral structure. The parent account should already exist and the child one should not.
func (Keeper) AreStatusRequirementsFulfilled ¶
func (k Keeper) AreStatusRequirementsFulfilled(ctx sdk.Context, acc string, s types.Status) (types.StatusCheckResult, error)
AreStatusRequirementsFulfilled validates if the account suffices the status requirement. The actual account status doesn't matter and won't be updated.
func (Keeper) ExportToGenesis ¶
func (Keeper) GetChildren ¶
func (Keeper) GetDelegatedInNetwork ¶
GetDelegatedInNetwork returns total amount of delegated coins in a person's network Own coins inclusive.
func (Keeper) GetReferralFeesForDelegating ¶
func (k Keeper) GetReferralFeesForDelegating(ctx sdk.Context, acc string) ([]types.ReferralFee, util.Fraction, error)
GetReferralFeesForDelegating returns a set of account-ratio pairs, describing what part of being delegated funds should go to what wallet. 0.15 total. The rest should be burned.
func (Keeper) GetStatus ¶
GetStatus returns a status for an account (i.e. lvl 1 "Lucky", lvl 2 "Leader", lvl 3 "Master" or so on)
func (Keeper) GetTopLevelAccounts ¶
GetTopLevelAccounts returns all accounts without parents and is supposed to be used during genesis export
func (Keeper) ImportFromGenesis ¶
func (Keeper) MustSetActive ¶
func (Keeper) MustSetActiveWithoutStatusUpdate ¶
func (k Keeper) MustSetActiveWithoutStatusUpdate(ctx sdk.Context, acc string, value bool, bu *bunchUpdater)
MustSetActiveWithoutStatusUpdate updates active referrals but skips status update check after it. So this check MUST be performed from the outer code later. This is useful for massive updates like genesis init, because it allows to avoid excessive checks repeating again and again for the same account (every time any of referrals up to 14 lines down changes its activity).
func (Keeper) OnBalanceChanged ¶
func (Keeper) PerfomStatusDowngradeSchedule ¶
func (Keeper) PerformDowngrade ¶
func (Keeper) PerformStatusBonus ¶
func (Keeper) RemoveStatusDowngradeSchedule ¶
func (Keeper) ScheduleStatusDowngrade ¶
type Querier ¶
type Querier struct {
Keeper
}
func NewQuerier ¶
func (Querier) CheckStatus ¶
func (qs Querier) CheckStatus(ctx context.Context, request *types.CheckStatusRequest) (*types.CheckStatusResponse, error)
func (Querier) Children ¶
func (qs Querier) Children(ctx context.Context, request *types.ChildrenRequest) (*types.ChildrenResponse, error)
func (Querier) Coins ¶
func (qs Querier) Coins(ctx context.Context, request *types.CoinsRequest) (*types.CoinsResponse, error)
func (Querier) Exists ¶
func (qs Querier) Exists(ctx context.Context, request *types.ExistsRequest) (*types.ExistsResponse, error)
func (Querier) Get ¶
func (qs Querier) Get(ctx context.Context, request *types.GetRequest) (*types.GetResponse, error)
func (Querier) Params ¶
func (qs Querier) Params(ctx context.Context, _ *types.ParamsRequest) (*types.ParamsResponse, error)