Documentation ¶
Index ¶
- func AllInvariants(k *Keeper) sdk.Invariant
- func ClaimRecordInvariant(k *Keeper) sdk.Invariant
- func HandleRegisterZoneDropProposal(ctx sdk.Context, k *Keeper, p *types.RegisterZoneDropProposal) error
- func NewMsgServerImpl(keeper *Keeper) types.MsgServer
- func RegisterInvariants(ir sdk.InvariantRegistry, k *Keeper)
- type ClaimRecords
- type Hooks
- type Keeper
- func (k *Keeper) AccountBalance(c context.Context, req *types.QueryAccountBalanceRequest) (*types.QueryAccountBalanceResponse, error)
- func (k *Keeper) AfterEpochEnd(_ sdk.Context, _ string, _ int64) error
- func (k *Keeper) AllActiveZoneDrops(ctx sdk.Context) []types.ZoneDrop
- func (k *Keeper) AllClaimRecords(ctx sdk.Context) []*types.ClaimRecord
- func (k *Keeper) AllExpiredZoneDrops(ctx sdk.Context) []types.ZoneDrop
- func (k *Keeper) AllFutureZoneDrops(ctx sdk.Context) []types.ZoneDrop
- func (k *Keeper) AllZoneClaimRecords(ctx sdk.Context, chainID string) []*types.ClaimRecord
- func (k *Keeper) AllZoneDrops(ctx sdk.Context) []*types.ZoneDrop
- func (k *Keeper) BeforeEpochStart(_ sdk.Context, _ string, _ int64) error
- func (k *Keeper) BondDenom(ctx sdk.Context) string
- func (k *Keeper) Claim(ctx sdk.Context, chainID string, action types.Action, address string, ...) (uint64, error)
- func (k *Keeper) ClaimRecord(c context.Context, req *types.QueryClaimRecordRequest) (*types.QueryClaimRecordResponse, error)
- func (k *Keeper) ClaimRecords(c context.Context, req *types.QueryClaimRecordsRequest) (*types.QueryClaimRecordsResponse, error)
- func (k *Keeper) ClearClaimRecords(ctx sdk.Context, chainID string)
- func (k *Keeper) DeleteClaimRecord(ctx sdk.Context, chainID, address string) error
- func (k *Keeper) DeleteZoneDrop(ctx sdk.Context, chainID string)
- func (k *Keeper) EndBlocker(ctx sdk.Context)
- func (k *Keeper) EndZoneDrop(ctx sdk.Context, chainID string) error
- func (k *Keeper) GetAuthority() string
- func (k *Keeper) GetClaimRecord(ctx sdk.Context, chainID, address string) (types.ClaimRecord, error)
- func (k *Keeper) GetClaimableAmountForAction(ctx sdk.Context, chainID, address string, action types.Action) (uint64, error)
- func (k *Keeper) GetClaimableAmountForUser(ctx sdk.Context, chainID, address string) (uint64, error)
- func (k *Keeper) GetModuleAccountAddress(_ sdk.Context) sdk.AccAddress
- func (k *Keeper) GetModuleAccountBalance(ctx sdk.Context) sdk.Coin
- func (k *Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k *Keeper) GetZoneDrop(ctx sdk.Context, chainID string) (types.ZoneDrop, bool)
- func (k *Keeper) GetZoneDropAccountAddress(chainID string) sdk.AccAddress
- func (k *Keeper) GetZoneDropAccountBalance(ctx sdk.Context, chainID string) sdk.Coin
- func (k *Keeper) HandleClaim(ctx sdk.Context, cr types.ClaimRecord, action types.Action, ...) (uint64, error)
- func (k *Keeper) Hooks() Hooks
- func (k *Keeper) IsActiveZoneDrop(ctx sdk.Context, zd types.ZoneDrop) bool
- func (k *Keeper) IsExpiredZoneDrop(ctx sdk.Context, zd types.ZoneDrop) bool
- func (k *Keeper) IsFutureZoneDrop(ctx sdk.Context, zd types.ZoneDrop) bool
- func (k *Keeper) IterateClaimRecords(ctx sdk.Context, chainID string, ...)
- func (k Keeper) IterateZoneDrops(ctx sdk.Context, fn func(index int64, zoneDrop types.ZoneDrop) (stop bool))
- func (k *Keeper) Logger(ctx sdk.Context) log.Logger
- func (k *Keeper) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k *Keeper) SendCoinsFromAccountToModule(ctx sdk.Context, senderAccount sdk.AccAddress, recipientModule string, ...) error
- func (k *Keeper) SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAccount sdk.AccAddress, ...) error
- func (k *Keeper) SendCoinsFromModuleToModule(ctx sdk.Context, senderModule, recipientModule string, amount sdk.Coins) error
- func (k *Keeper) SetClaimRecord(ctx sdk.Context, cr types.ClaimRecord) error
- func (k *Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k *Keeper) SetZoneDrop(ctx sdk.Context, zd types.ZoneDrop)
- func (k *Keeper) UnconcludedAirdrops(ctx sdk.Context) []types.ZoneDrop
- func (k *Keeper) ZoneDrop(c context.Context, req *types.QueryZoneDropRequest) (*types.QueryZoneDropResponse, error)
- func (k *Keeper) ZoneDrops(c context.Context, req *types.QueryZoneDropsRequest) (*types.QueryZoneDropsResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllInvariants ¶
AllInvariants runs all invariants of the module.
func ClaimRecordInvariant ¶
func HandleRegisterZoneDropProposal ¶
func HandleRegisterZoneDropProposal(ctx sdk.Context, k *Keeper, p *types.RegisterZoneDropProposal) error
HandleRegisterZoneDropProposal is a handler for executing a passed airdrop proposal.
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 airdrop invariants.
Types ¶
type ClaimRecords ¶
type ClaimRecords []types.ClaimRecord
type Hooks ¶
type Hooks struct {
// contains filtered or unexported fields
}
Hooks wrapper struct for airdrop keeper.
func (Hooks) AfterEpochEnd ¶
type Keeper ¶
type Keeper struct { ValidateProofOps utils.ProofOpsFn // contains filtered or unexported fields }
func NewKeeper ¶
func NewKeeper( cdc codec.Codec, key storetypes.StoreKey, ps paramtypes.Subspace, ak types.AccountKeeper, bk types.BankKeeper, sk types.StakingKeeper, gk govkeeper.Keeper, icsk icskeeper.Keeper, icqk icqkeeper.Keeper, prk *prkeeper.Keeper, pofn utils.ProofOpsFn, authority string, ) *Keeper
NewKeeper returns a new instance of participationrewards Keeper. This function will panic on failure.
func (*Keeper) AccountBalance ¶
func (k *Keeper) AccountBalance(c context.Context, req *types.QueryAccountBalanceRequest) (*types.QueryAccountBalanceResponse, error)
AccountBalance returns the airdrop module account balance of the specified zone.
func (*Keeper) AfterEpochEnd ¶
func (*Keeper) AllActiveZoneDrops ¶
AllActiveZoneDrops returns all active zone airdrops.
func (*Keeper) AllClaimRecords ¶
func (k *Keeper) AllClaimRecords(ctx sdk.Context) []*types.ClaimRecord
AllClaimRecords returns all the claim records.
func (*Keeper) AllExpiredZoneDrops ¶
AllExpiredZoneDrops returns all expired zone airdrops.
func (*Keeper) AllFutureZoneDrops ¶
AllFutureZoneDrops returns all future zone airdrops.
func (*Keeper) AllZoneClaimRecords ¶
AllZoneClaimRecords returns all the claim records of the given zone.
func (*Keeper) AllZoneDrops ¶
AllZoneDrops returns all zone airdrops (active, future, expired).
func (*Keeper) BeforeEpochStart ¶
func (*Keeper) Claim ¶
func (k *Keeper) Claim( ctx sdk.Context, chainID string, action types.Action, address string, proofs []*cmtypes.Proof, ) (uint64, error)
Claim executes an airdrop claim for the given address on the given action against the given zone (chainID). It returns the claim amount or an error on failure.
func (*Keeper) ClaimRecord ¶
func (k *Keeper) ClaimRecord(c context.Context, req *types.QueryClaimRecordRequest) (*types.QueryClaimRecordResponse, error)
ClaimRecord returns the claim record that corresponds to the given zone and address.
func (*Keeper) ClaimRecords ¶
func (k *Keeper) ClaimRecords(c context.Context, req *types.QueryClaimRecordsRequest) (*types.QueryClaimRecordsResponse, error)
ClaimRecords returns all the claim records of the given zone.
func (*Keeper) ClearClaimRecords ¶
ClearClaimRecords deletes all the claim records of the given zone.
func (*Keeper) DeleteClaimRecord ¶
DeleteClaimRecord deletes the airdrop ClaimRecord of the given zone and address.
func (*Keeper) DeleteZoneDrop ¶
DeleteZoneDrop deletes the airdrop of the zone identified by chainID.
func (*Keeper) EndBlocker ¶
EndBlocker of airdrop module.
func (*Keeper) EndZoneDrop ¶
EndZoneDrop concludes a zone airdrop. It deletes all ClaimRecords for the given zone.
func (*Keeper) GetAuthority ¶
GetAuthority returns the x/airdrop module's authority.
func (*Keeper) GetClaimRecord ¶
func (k *Keeper) GetClaimRecord(ctx sdk.Context, chainID, address string) (types.ClaimRecord, error)
GetClaimRecord returns the ClaimRecord of the given address for the given zone.
func (*Keeper) GetClaimableAmountForAction ¶
func (k *Keeper) GetClaimableAmountForAction(ctx sdk.Context, chainID, address string, action types.Action) (uint64, error)
GetClaimableAmountForAction returns the amount claimable for the given action, by the given address, against the given zone.
func (*Keeper) GetClaimableAmountForUser ¶
func (k *Keeper) GetClaimableAmountForUser(ctx sdk.Context, chainID, address string) (uint64, error)
GetClaimableAmountForUser returns the amount claimable for the given user against the given zone.
func (*Keeper) GetModuleAccountAddress ¶
func (k *Keeper) GetModuleAccountAddress(_ sdk.Context) sdk.AccAddress
GetModuleAccountAddress gets the airdrop module account address.
func (*Keeper) GetModuleAccountBalance ¶
GetModuleAccountBalance gets the airdrop module account coin balance.
func (*Keeper) GetZoneDrop ¶
GetZoneDrop returns airdrop details for the zone identified by chainID.
func (*Keeper) GetZoneDropAccountAddress ¶
func (k *Keeper) GetZoneDropAccountAddress(chainID string) sdk.AccAddress
GetZoneDropAccountAddress returns the zone airdrop account address.
func (*Keeper) GetZoneDropAccountBalance ¶
GetZoneDropAccountBalance gets the zone airdrop account coin balance.
func (*Keeper) HandleClaim ¶
func (*Keeper) IsActiveZoneDrop ¶
IsActiveZoneDrop returns true if the zone airdrop is currently active.
`timeline: |----------s----------D----------d----------|` ` ^---------------------^ `
s: StartTime (time.Time) D: Duration (time.Duration) ... s+D d: decay (time.Duration) ... s+D+d
isActive: s <= timenow <= s+D+d notActive: timenow < s || timenow > s+D+d.
func (*Keeper) IsExpiredZoneDrop ¶
IsExpiredZoneDrop returns true if the zone airdrop has already expired.
`timeline: |----------s----------D----------d----------|` ` ^---------^`
s: StartTime (time.Time) D: Duration (time.Duration) ... s+D d: decay (time.Duration) ... s+D+d
isExpired: timenow > s+D+d notExpired: timenow < s+D+d.
func (*Keeper) IsFutureZoneDrop ¶
IsFutureZoneDrop returns true if the zone airdrop is in the future.
`timeline: |----------s----------D----------d----------|` ` ^---------^ `
s: StartTime (time.Time) D: Duration (time.Duration) ... s+D d: decay (time.Duration) ... s+D+d
isFuture: timenow < s notFuture: s <= timenow.
func (*Keeper) IterateClaimRecords ¶
func (k *Keeper) IterateClaimRecords(ctx sdk.Context, chainID string, fn func(index int64, cr types.ClaimRecord) (stop bool))
IterateClaimRecords iterate through zone airdrop ClaimRecords.
func (Keeper) IterateZoneDrops ¶
func (k Keeper) IterateZoneDrops(ctx sdk.Context, fn func(index int64, zoneDrop types.ZoneDrop) (stop bool))
IterateZoneDrops iterates through zone airdrops.
func (*Keeper) Params ¶
func (k *Keeper) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Params returns params of the airdrop module.
func (*Keeper) SendCoinsFromAccountToModule ¶
func (*Keeper) SendCoinsFromModuleToAccount ¶
func (*Keeper) SendCoinsFromModuleToModule ¶
func (*Keeper) SetClaimRecord ¶
SetClaimRecord creates/updates the given airdrop ClaimRecord.
func (*Keeper) SetZoneDrop ¶
SetZoneDrop creates/updates the given zone airdrop (ZoneDrop).
func (*Keeper) UnconcludedAirdrops ¶
UnconcludedAirdrops returns all expired zone airdrops that have not yet been concluded.
func (*Keeper) ZoneDrop ¶
func (k *Keeper) ZoneDrop(c context.Context, req *types.QueryZoneDropRequest) (*types.QueryZoneDropResponse, error)
ZoneDrop returns the details of the specified zone airdrop.
func (*Keeper) ZoneDrops ¶
func (k *Keeper) ZoneDrops(c context.Context, req *types.QueryZoneDropsRequest) (*types.QueryZoneDropsResponse, error)
ZoneDrops returns all zone airdrops of the specified status.