keeper

package
v0.0.0-...-018c514 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2023 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllInvariants

func AllInvariants(k *Keeper) sdk.Invariant

AllInvariants runs all invariants of the module.

func ClaimRecordInvariant

func ClaimRecordInvariant(k *Keeper) sdk.Invariant

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

func NewMsgServerImpl(keeper *Keeper) types.MsgServer

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

func (h Hooks) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, epochNumber int64) error

func (Hooks) BeforeEpochStart

func (h Hooks) BeforeEpochStart(ctx sdk.Context, epochIdentifier string, epochNumber int64) error

type Keeper

type Keeper struct {
	ValidateProofOps utils.ProofOpsFn
	// contains filtered or unexported fields
}

func NewKeeper

NewKeeper returns a new instance of participationrewards Keeper. This function will panic on failure.

func (*Keeper) AccountBalance

AccountBalance returns the airdrop module account balance of the specified zone.

func (*Keeper) AfterEpochEnd

func (k *Keeper) AfterEpochEnd(_ sdk.Context, _ string, _ int64) error

func (*Keeper) AllActiveZoneDrops

func (k *Keeper) AllActiveZoneDrops(ctx sdk.Context) []types.ZoneDrop

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

func (k *Keeper) AllExpiredZoneDrops(ctx sdk.Context) []types.ZoneDrop

AllExpiredZoneDrops returns all expired zone airdrops.

func (*Keeper) AllFutureZoneDrops

func (k *Keeper) AllFutureZoneDrops(ctx sdk.Context) []types.ZoneDrop

AllFutureZoneDrops returns all future zone airdrops.

func (*Keeper) AllZoneClaimRecords

func (k *Keeper) AllZoneClaimRecords(ctx sdk.Context, chainID string) []*types.ClaimRecord

AllZoneClaimRecords returns all the claim records of the given zone.

func (*Keeper) AllZoneDrops

func (k *Keeper) AllZoneDrops(ctx sdk.Context) []*types.ZoneDrop

AllZoneDrops returns all zone airdrops (active, future, expired).

func (*Keeper) BeforeEpochStart

func (k *Keeper) BeforeEpochStart(_ sdk.Context, _ string, _ int64) error

func (*Keeper) BondDenom

func (k *Keeper) BondDenom(ctx sdk.Context) string

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

ClaimRecord returns the claim record that corresponds to the given zone and address.

func (*Keeper) ClaimRecords

ClaimRecords returns all the claim records of the given zone.

func (*Keeper) ClearClaimRecords

func (k *Keeper) ClearClaimRecords(ctx sdk.Context, chainID string)

ClearClaimRecords deletes all the claim records of the given zone.

func (*Keeper) DeleteClaimRecord

func (k *Keeper) DeleteClaimRecord(ctx sdk.Context, chainID, address string) error

DeleteClaimRecord deletes the airdrop ClaimRecord of the given zone and address.

func (*Keeper) DeleteZoneDrop

func (k *Keeper) DeleteZoneDrop(ctx sdk.Context, chainID string)

DeleteZoneDrop deletes the airdrop of the zone identified by chainID.

func (*Keeper) EndBlocker

func (k *Keeper) EndBlocker(ctx sdk.Context)

EndBlocker of airdrop module.

func (*Keeper) EndZoneDrop

func (k *Keeper) EndZoneDrop(ctx sdk.Context, chainID string) error

EndZoneDrop concludes a zone airdrop. It deletes all ClaimRecords for the given zone.

func (*Keeper) GetAuthority

func (k *Keeper) GetAuthority() string

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

func (k *Keeper) GetModuleAccountBalance(ctx sdk.Context) sdk.Coin

GetModuleAccountBalance gets the airdrop module account coin balance.

func (*Keeper) GetParams

func (k *Keeper) GetParams(ctx sdk.Context) (params types.Params)

GetParams returns the total set of airdrop parameters.

func (*Keeper) GetZoneDrop

func (k *Keeper) GetZoneDrop(ctx sdk.Context, chainID string) (types.ZoneDrop, bool)

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

func (k *Keeper) GetZoneDropAccountBalance(ctx sdk.Context, chainID string) sdk.Coin

GetZoneDropAccountBalance gets the zone airdrop account coin balance.

func (*Keeper) HandleClaim

func (k *Keeper) HandleClaim(ctx sdk.Context, cr types.ClaimRecord, action types.Action, proofs []*cmtypes.Proof) (uint64, error)

func (*Keeper) Hooks

func (k *Keeper) Hooks() Hooks

func (*Keeper) IsActiveZoneDrop

func (k *Keeper) IsActiveZoneDrop(ctx sdk.Context, zd types.ZoneDrop) bool

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

func (k *Keeper) IsExpiredZoneDrop(ctx sdk.Context, zd types.ZoneDrop) bool

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

func (k *Keeper) IsFutureZoneDrop(ctx sdk.Context, zd types.ZoneDrop) bool

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) Logger

func (k *Keeper) Logger(ctx sdk.Context) log.Logger

Logger returns a module-specific logger.

func (*Keeper) Params

Params returns params of the airdrop module.

func (*Keeper) SendCoinsFromAccountToModule

func (k *Keeper) SendCoinsFromAccountToModule(ctx sdk.Context, senderAccount sdk.AccAddress, recipientModule string, amount sdk.Coins) error

func (*Keeper) SendCoinsFromModuleToAccount

func (k *Keeper) SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAccount sdk.AccAddress, amount sdk.Coins) error

func (*Keeper) SendCoinsFromModuleToModule

func (k *Keeper) SendCoinsFromModuleToModule(ctx sdk.Context, senderModule, recipientModule string, amount sdk.Coins) error

func (*Keeper) SetClaimRecord

func (k *Keeper) SetClaimRecord(ctx sdk.Context, cr types.ClaimRecord) error

SetClaimRecord creates/updates the given airdrop ClaimRecord.

func (*Keeper) SetParams

func (k *Keeper) SetParams(ctx sdk.Context, params types.Params)

SetParams sets the total set of airdrop parameters.

func (*Keeper) SetZoneDrop

func (k *Keeper) SetZoneDrop(ctx sdk.Context, zd types.ZoneDrop)

SetZoneDrop creates/updates the given zone airdrop (ZoneDrop).

func (*Keeper) UnconcludedAirdrops

func (k *Keeper) UnconcludedAirdrops(ctx sdk.Context) []types.ZoneDrop

UnconcludedAirdrops returns all expired zone airdrops that have not yet been concluded.

func (*Keeper) ZoneDrop

ZoneDrop returns the details of the specified zone airdrop.

func (*Keeper) ZoneDrops

ZoneDrops returns all zone airdrops of the specified status.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL