Documentation ¶
Index ¶
- func AllInvariants(k Keeper) sdk.Invariant
- func CalculateRewards(blockRatio, signatureRatio sdkmath.LegacyDec, coins sdk.Coins) (sdk.Coins, error)
- func InsufficientRewardsBalanceInvariant(k Keeper) sdk.Invariant
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func NewQueryServerImpl(k Keeper) types.QueryServer
- func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
- func SetBalance(ctx context.Context, bankKeeper types.BankKeeper, provider sdk.AccAddress, ...) error
- type Keeper
- func (k Keeper) AddressCodec() address.Codec
- func (k Keeper) DistributeRewards(ctx context.Context, launchID uint64, ...) error
- func (k Keeper) GetAuthority() string
- func (k *Keeper) GetLaunchKeeper() types.LaunchKeeper
- func (k *Keeper) GetProfileKeeper() types.ProfileKeeper
- func (k Keeper) ListRewardPool(ctx sdk.Context) ([]types.RewardPool, error)
- func (k Keeper) Logger() log.Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllInvariants ¶
AllInvariants runs all invariants of the module.
func CalculateRewards ¶
func CalculateRewards(blockRatio, signatureRatio sdkmath.LegacyDec, coins sdk.Coins) (sdk.Coins, error)
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 NewQueryServerImpl ¶
func NewQueryServerImpl(k Keeper) types.QueryServer
NewQueryServerImpl returns an implementation of the QueryServer interface for the provided Keeper.
func RegisterInvariants ¶
func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
RegisterInvariants registers all module invariants
func SetBalance ¶
func SetBalance( ctx context.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 { Schema collections.Schema Params collections.Item[types.Params] RewardPool collections.Map[uint64, types.RewardPool] // contains filtered or unexported fields }
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, addressCodec address.Codec, storeService store.KVStoreService, logger log.Logger, authority string, accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, profileKeeper types.ProfileKeeper, launchKeeper types.LaunchKeeper, ) Keeper
func (Keeper) AddressCodec ¶
AddressCodec returns the address codec.
func (Keeper) DistributeRewards ¶
func (k Keeper) DistributeRewards( ctx context.Context, launchID uint64, signatureCounts networktypes.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) GetAuthority ¶
GetAuthority returns the module's authority.
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) ListRewardPool ¶
ListRewardPool returns all rewardPool