Documentation ¶
Index ¶
- func AllInvariants(k Keeper) sdk.Invariant
- func CalculateRewards(blockRatio, signatureRatio sdk.Dec, coins sdk.Coins) (sdk.Coins, error)
- func InsufficientRewardsBalanceInvariant(k Keeper) sdk.Invariant
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
- func SetBalance(ctx sdk.Context, bankKeeper types.BankKeeper, provider sdk.AccAddress, ...) error
- type Keeper
- func (k Keeper) DistributeRewards(ctx sdk.Context, launchID uint64, signatureCounts spntypes.SignatureCounts, ...) error
- func (k Keeper) GetAllRewardPool(ctx sdk.Context) (list []types.RewardPool)
- func (k *Keeper) GetLaunchKeeper() types.LaunchKeeper
- func (k Keeper) GetParams(ctx sdk.Context) types.Params
- func (k *Keeper) GetProfileKeeper() types.ProfileKeeper
- func (k Keeper) GetRewardPool(ctx sdk.Context, launchID uint64) (val types.RewardPool, found bool)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) RemoveRewardPool(ctx sdk.Context, launchID uint64)
- func (k Keeper) RewardPool(c context.Context, req *types.QueryGetRewardPoolRequest) (*types.QueryGetRewardPoolResponse, error)
- func (k Keeper) RewardPoolAll(c context.Context, req *types.QueryAllRewardPoolRequest) (*types.QueryAllRewardPoolResponse, error)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetRewardPool(ctx sdk.Context, rewardPool types.RewardPool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllInvariants ¶
AllInvariants runs all invariants of the module.
func CalculateRewards ¶
CalculateRewards calculates the reward relative to the signature and block ratio
func InsufficientRewardsBalanceInvariant ¶
InsufficientRewardsBalanceInvariant checks if module account balance is greater or equal than the sum of all `remainingCoins` for all reward pools
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.
func RegisterInvariants ¶
func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
RegisterInvariants registers all module invariants
func SetBalance ¶
func SetBalance( ctx sdk.Context, bankKeeper types.BankKeeper, provider sdk.AccAddress, coins sdk.Coins, poolCoins sdk.Coins, ) error
SetBalance set balance to Coins on the module account calling the transfer depending on the balance difference
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeKey, memKey storetypes.StoreKey, ps paramtypes.Subspace, authKeeper types.AccountKeeper, bankKeeper types.BankKeeper, profileKeeper types.ProfileKeeper, launchKeeper types.LaunchKeeper, ) *Keeper
func (Keeper) DistributeRewards ¶
func (k Keeper) DistributeRewards( ctx sdk.Context, launchID uint64, signatureCounts spntypes.SignatureCounts, lastBlockHeight int64, closeRewardPool bool, ) error
DistributeRewards distributes rewards based on the monitoring packet this `closeRewardPool` is a boolean that specifies if the reward pool must be closed after the reward distribution. In a model where rewards are distributed in a single round, this boolean is always `true`. In this way, if the monitoring packet is distributed earlier and `lastBlockHeight < rewardPool.LastRewardHeight` only a portion of the rewards will be distributed and the remaining is refunded to the reward's provider. When rewards are distributed periodically, this value is set to `false` so the reward pool is not closed as long as `lastBlockHeight` does not reach `rewardPool.LastRewardHeight`
func (Keeper) GetAllRewardPool ¶
func (k Keeper) GetAllRewardPool(ctx sdk.Context) (list []types.RewardPool)
GetAllRewardPool returns all rewardPool
func (*Keeper) GetLaunchKeeper ¶
func (k *Keeper) GetLaunchKeeper() types.LaunchKeeper
GetLaunchKeeper gets the profile keeper interface of the module
func (*Keeper) GetProfileKeeper ¶
func (k *Keeper) GetProfileKeeper() types.ProfileKeeper
GetProfileKeeper gets the profile keeper interface of the module
func (Keeper) GetRewardPool ¶
GetRewardPool returns a rewardPool from its index
func (Keeper) Params ¶
func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (Keeper) RemoveRewardPool ¶
RemoveRewardPool removes a rewardPool from the store
func (Keeper) RewardPool ¶
func (k Keeper) RewardPool(c context.Context, req *types.QueryGetRewardPoolRequest) (*types.QueryGetRewardPoolResponse, error)
func (Keeper) RewardPoolAll ¶
func (k Keeper) RewardPoolAll(c context.Context, req *types.QueryAllRewardPoolRequest) (*types.QueryAllRewardPoolResponse, error)
func (Keeper) SetRewardPool ¶
func (k Keeper) SetRewardPool(ctx sdk.Context, rewardPool types.RewardPool)
SetRewardPool set a specific rewardPool in the store from its index