keeper

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: Apache-2.0 Imports: 17 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AirdropSupplyInvariant

func AirdropSupplyInvariant(k Keeper) sdk.Invariant

AirdropSupplyInvariant invariant checks that airdrop supply is equal to the remaining claimable amounts in claim records

func AllInvariants

func AllInvariants(k Keeper) sdk.Invariant

AllInvariants runs all invariants of the module.

func ClaimRecordInvariant

func ClaimRecordInvariant(k Keeper) sdk.Invariant

ClaimRecordInvariant invariant checks that claim record was claimed but not completed

func ClaimRecordMissionInvariant

func ClaimRecordMissionInvariant(k Keeper) sdk.Invariant

ClaimRecordMissionInvariant invariant checks that claim record completed missions exist

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 module invariants

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,
	accountKeeper types.AccountKeeper,
	distrkeeper types.DistrKeeper,
	bankKeeper types.BankKeeper,
) *Keeper

func (Keeper) AirdropStart

func (k Keeper) AirdropStart(ctx sdk.Context) (airdropStart time.Time)

AirdropStart returns the param that defines airdrop start

func (Keeper) ClaimMission

func (k Keeper) ClaimMission(
	ctx sdk.Context,
	claimRecord types.ClaimRecord,
	missionID uint64,
) (claimed math.Int, err error)

ClaimMission distributes the claimable portion of the airdrop to the user the method fails if the mission has already been claimed or not completed

func (Keeper) CompleteMission

func (k Keeper) CompleteMission(
	ctx sdk.Context,
	missionID uint64,
	address string,
) (claimed math.Int, err error)

CompleteMission saves the completion of the mission. The claim will be called automatically if the airdrop start has already been reached. If not, it will only save the mission as completed.

func (Keeper) DecayInformation

func (k Keeper) DecayInformation(ctx sdk.Context) (totalSupplyRange types.DecayInformation)

DecayInformation returns the param that defines decay information

func (Keeper) EndAirdrop

func (k Keeper) EndAirdrop(ctx sdk.Context) error

func (Keeper) GetAirdropSupply

func (k Keeper) GetAirdropSupply(ctx sdk.Context) (val sdk.Coin, found bool)

GetAirdropSupply returns airdropSupply

func (Keeper) GetAllClaimRecord

func (k Keeper) GetAllClaimRecord(ctx sdk.Context) (list []types.ClaimRecord)

GetAllClaimRecord returns all claimRecord

func (Keeper) GetAllMission

func (k Keeper) GetAllMission(ctx sdk.Context) (list []types.Mission)

GetAllMission returns all mission

func (Keeper) GetClaimRecord

func (k Keeper) GetClaimRecord(ctx sdk.Context, address string) (val types.ClaimRecord, found bool)

GetClaimRecord returns a claimRecord from its index

func (Keeper) GetInitialClaim

func (k Keeper) GetInitialClaim(ctx sdk.Context) (val types.InitialClaim, found bool)

GetInitialClaim returns initialClaim

func (Keeper) GetMission

func (k Keeper) GetMission(ctx sdk.Context, id uint64) (val types.Mission, found bool)

GetMission returns a mission from its id

func (Keeper) GetParams

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

GetParams get all parameters as types.Params

func (Keeper) InitializeAirdropSupply

func (k Keeper) InitializeAirdropSupply(ctx sdk.Context, airdropSupply sdk.Coin) error

InitializeAirdropSupply set the airdrop supply in the store and set the module balance

func (Keeper) Logger

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

func (Keeper) NewMissionDelegationHooks

func (k Keeper) NewMissionDelegationHooks(missionID uint64) MissionDelegationHooks

NewMissionDelegationHooks returns a StakingHooks that triggers mission completion on delegation for an account

func (Keeper) NewMissionVoteHooks

func (k Keeper) NewMissionVoteHooks(missionID uint64) MissionVoteHooks

NewMissionVoteHooks returns a GovHooks that triggers mission completion on voting for a proposal

func (Keeper) Params

func (Keeper) RemoveAirdropSupply

func (k Keeper) RemoveAirdropSupply(ctx sdk.Context)

RemoveAirdropSupply removes the AirdropSupply from the store

func (Keeper) RemoveClaimRecord

func (k Keeper) RemoveClaimRecord(
	ctx sdk.Context,
	address string,
)

RemoveClaimRecord removes a claimRecord from the store

func (Keeper) RemoveInitialClaim

func (k Keeper) RemoveInitialClaim(ctx sdk.Context)

RemoveInitialClaim removes initialClaim from the store

func (Keeper) RemoveMission

func (k Keeper) RemoveMission(ctx sdk.Context, id uint64)

RemoveMission removes a mission from the store

func (Keeper) SetAirdropSupply

func (k Keeper) SetAirdropSupply(ctx sdk.Context, airdropSupply sdk.Coin)

SetAirdropSupply set airdropSupply in the store

func (Keeper) SetClaimRecord

func (k Keeper) SetClaimRecord(ctx sdk.Context, claimRecord types.ClaimRecord)

SetClaimRecord set a specific claimRecord in the store from its index

func (Keeper) SetInitialClaim

func (k Keeper) SetInitialClaim(ctx sdk.Context, initialClaim types.InitialClaim)

SetInitialClaim set initialClaim in the store

func (Keeper) SetMission

func (k Keeper) SetMission(ctx sdk.Context, mission types.Mission)

SetMission set a specific mission in the store

func (Keeper) SetParams

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

SetParams set the params

type MissionDelegationHooks

type MissionDelegationHooks struct {
	// contains filtered or unexported fields
}

func (MissionDelegationHooks) AfterDelegationModified

func (h MissionDelegationHooks) AfterDelegationModified(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) error

AfterDelegationModified implements StakingHooks

func (MissionDelegationHooks) AfterUnbondingInitiated

func (h MissionDelegationHooks) AfterUnbondingInitiated(sdk.Context, uint64) error

AfterUnbondingInitiated implements StakingHooks

func (MissionDelegationHooks) AfterValidatorBeginUnbonding

func (h MissionDelegationHooks) AfterValidatorBeginUnbonding(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error

AfterValidatorBeginUnbonding implements StakingHooks

func (MissionDelegationHooks) AfterValidatorBonded

func (h MissionDelegationHooks) AfterValidatorBonded(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error

AfterValidatorBonded implements StakingHooks

func (MissionDelegationHooks) AfterValidatorCreated

func (h MissionDelegationHooks) AfterValidatorCreated(_ sdk.Context, _ sdk.ValAddress) error

AfterValidatorCreated implements StakingHooks

func (MissionDelegationHooks) AfterValidatorRemoved

func (h MissionDelegationHooks) AfterValidatorRemoved(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error

AfterValidatorRemoved implements StakingHooks

func (MissionDelegationHooks) BeforeDelegationCreated

func (h MissionDelegationHooks) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, _ sdk.ValAddress) error

BeforeDelegationCreated completes mission when a delegation is performed

func (MissionDelegationHooks) BeforeDelegationRemoved

func (h MissionDelegationHooks) BeforeDelegationRemoved(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) error

BeforeDelegationRemoved implements StakingHooks

func (MissionDelegationHooks) BeforeDelegationSharesModified

func (h MissionDelegationHooks) BeforeDelegationSharesModified(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) error

BeforeDelegationSharesModified implements StakingHooks

func (MissionDelegationHooks) BeforeValidatorModified

func (h MissionDelegationHooks) BeforeValidatorModified(_ sdk.Context, _ sdk.ValAddress) error

BeforeValidatorModified implements StakingHooks

func (MissionDelegationHooks) BeforeValidatorSlashed

func (h MissionDelegationHooks) BeforeValidatorSlashed(_ sdk.Context, _ sdk.ValAddress, _ sdk.Dec) error

BeforeValidatorSlashed implements StakingHooks

type MissionVoteHooks

type MissionVoteHooks struct {
	// contains filtered or unexported fields
}

func (MissionVoteHooks) AfterProposalDeposit

func (h MissionVoteHooks) AfterProposalDeposit(_ sdk.Context, _ uint64, _ sdk.AccAddress)

AfterProposalDeposit implements GovHooks

func (MissionVoteHooks) AfterProposalFailedMinDeposit

func (h MissionVoteHooks) AfterProposalFailedMinDeposit(_ sdk.Context, _ uint64)

AfterProposalFailedMinDeposit implements GovHooks

func (MissionVoteHooks) AfterProposalSubmission

func (h MissionVoteHooks) AfterProposalSubmission(_ sdk.Context, _ uint64)

AfterProposalSubmission implements GovHooks

func (MissionVoteHooks) AfterProposalVote

func (h MissionVoteHooks) AfterProposalVote(ctx sdk.Context, _ uint64, voterAddr sdk.AccAddress)

AfterProposalVote completes mission when a vote is cast

func (MissionVoteHooks) AfterProposalVotingPeriodEnded

func (h MissionVoteHooks) AfterProposalVotingPeriodEnded(_ sdk.Context, _ uint64)

AfterProposalVotingPeriodEnded implements GovHooks

Jump to

Keyboard shortcuts

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