Documentation ¶
Index ¶
- func AirdropSupplyInvariant(k Keeper) sdk.Invariant
- func AllInvariants(k Keeper) sdk.Invariant
- func ClaimRecordInvariant(k Keeper) sdk.Invariant
- func ClaimRecordMissionInvariant(k Keeper) sdk.Invariant
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
- type Keeper
- func (k Keeper) AirdropStart(ctx sdk.Context) (airdropStart time.Time)
- func (k Keeper) AirdropSupply(c context.Context, req *types.QueryGetAirdropSupplyRequest) (*types.QueryGetAirdropSupplyResponse, error)
- func (k Keeper) ClaimMission(ctx sdk.Context, claimRecord types.ClaimRecord, missionID uint64) (claimed math.Int, err error)
- func (k Keeper) ClaimRecord(c context.Context, req *types.QueryGetClaimRecordRequest) (*types.QueryGetClaimRecordResponse, error)
- func (k Keeper) ClaimRecordAll(c context.Context, req *types.QueryAllClaimRecordRequest) (*types.QueryAllClaimRecordResponse, error)
- func (k Keeper) CompleteMission(ctx sdk.Context, missionID uint64, address string) (claimed math.Int, err error)
- func (k Keeper) DecayInformation(ctx sdk.Context) (totalSupplyRange types.DecayInformation)
- func (k Keeper) EndAirdrop(ctx sdk.Context) error
- func (k Keeper) GetAirdropSupply(ctx sdk.Context) (val sdk.Coin, found bool)
- func (k Keeper) GetAllClaimRecord(ctx sdk.Context) (list []types.ClaimRecord)
- func (k Keeper) GetAllMission(ctx sdk.Context) (list []types.Mission)
- func (k Keeper) GetClaimRecord(ctx sdk.Context, address string) (val types.ClaimRecord, found bool)
- func (k Keeper) GetInitialClaim(ctx sdk.Context) (val types.InitialClaim, found bool)
- func (k Keeper) GetMission(ctx sdk.Context, id uint64) (val types.Mission, found bool)
- func (k Keeper) GetParams(ctx sdk.Context) types.Params
- func (k Keeper) InitialClaim(c context.Context, req *types.QueryGetInitialClaimRequest) (*types.QueryGetInitialClaimResponse, error)
- func (k Keeper) InitializeAirdropSupply(ctx sdk.Context, airdropSupply sdk.Coin) error
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) Mission(c context.Context, req *types.QueryGetMissionRequest) (*types.QueryGetMissionResponse, error)
- func (k Keeper) MissionAll(c context.Context, req *types.QueryAllMissionRequest) (*types.QueryAllMissionResponse, error)
- func (k Keeper) NewMissionDelegationHooks(missionID uint64) MissionDelegationHooks
- func (k Keeper) NewMissionVoteHooks(missionID uint64) MissionVoteHooks
- func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) RemoveAirdropSupply(ctx sdk.Context)
- func (k Keeper) RemoveClaimRecord(ctx sdk.Context, address string)
- func (k Keeper) RemoveInitialClaim(ctx sdk.Context)
- func (k Keeper) RemoveMission(ctx sdk.Context, id uint64)
- func (k Keeper) SetAirdropSupply(ctx sdk.Context, airdropSupply sdk.Coin)
- func (k Keeper) SetClaimRecord(ctx sdk.Context, claimRecord types.ClaimRecord)
- func (k Keeper) SetInitialClaim(ctx sdk.Context, initialClaim types.InitialClaim)
- func (k Keeper) SetMission(ctx sdk.Context, mission types.Mission)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- type MissionDelegationHooks
- func (h MissionDelegationHooks) AfterDelegationModified(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) error
- func (h MissionDelegationHooks) AfterUnbondingInitiated(sdk.Context, uint64) error
- func (h MissionDelegationHooks) AfterValidatorBeginUnbonding(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error
- func (h MissionDelegationHooks) AfterValidatorBonded(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error
- func (h MissionDelegationHooks) AfterValidatorCreated(_ sdk.Context, _ sdk.ValAddress) error
- func (h MissionDelegationHooks) AfterValidatorRemoved(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error
- func (h MissionDelegationHooks) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, _ sdk.ValAddress) error
- func (h MissionDelegationHooks) BeforeDelegationRemoved(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) error
- func (h MissionDelegationHooks) BeforeDelegationSharesModified(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) error
- func (h MissionDelegationHooks) BeforeValidatorModified(_ sdk.Context, _ sdk.ValAddress) error
- func (h MissionDelegationHooks) BeforeValidatorSlashed(_ sdk.Context, _ sdk.ValAddress, _ sdk.Dec) error
- type MissionVoteHooks
- func (h MissionVoteHooks) AfterProposalDeposit(_ sdk.Context, _ uint64, _ sdk.AccAddress)
- func (h MissionVoteHooks) AfterProposalFailedMinDeposit(_ sdk.Context, _ uint64)
- func (h MissionVoteHooks) AfterProposalSubmission(_ sdk.Context, _ uint64)
- func (h MissionVoteHooks) AfterProposalVote(ctx sdk.Context, _ uint64, voterAddr sdk.AccAddress)
- func (h MissionVoteHooks) AfterProposalVotingPeriodEnded(_ sdk.Context, _ uint64)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AirdropSupplyInvariant ¶
AirdropSupplyInvariant invariant checks that airdrop supply is equal to the remaining claimable amounts in claim records
func AllInvariants ¶
AllInvariants runs all invariants of the module.
func ClaimRecordInvariant ¶
ClaimRecordInvariant invariant checks that claim record was claimed but not completed
func ClaimRecordMissionInvariant ¶
ClaimRecordMissionInvariant invariant checks that claim record completed missions exist
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
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 ¶
AirdropStart returns the param that defines airdrop start
func (Keeper) AirdropSupply ¶
func (k Keeper) AirdropSupply(c context.Context, req *types.QueryGetAirdropSupplyRequest) (*types.QueryGetAirdropSupplyResponse, error)
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) ClaimRecord ¶
func (k Keeper) ClaimRecord(c context.Context, req *types.QueryGetClaimRecordRequest) (*types.QueryGetClaimRecordResponse, error)
func (Keeper) ClaimRecordAll ¶
func (k Keeper) ClaimRecordAll(c context.Context, req *types.QueryAllClaimRecordRequest) (*types.QueryAllClaimRecordResponse, error)
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) GetAirdropSupply ¶
GetAirdropSupply returns airdropSupply
func (Keeper) GetAllClaimRecord ¶
func (k Keeper) GetAllClaimRecord(ctx sdk.Context) (list []types.ClaimRecord)
GetAllClaimRecord returns all claimRecord
func (Keeper) GetAllMission ¶
GetAllMission returns all mission
func (Keeper) GetClaimRecord ¶
GetClaimRecord returns a claimRecord from its index
func (Keeper) GetInitialClaim ¶
GetInitialClaim returns initialClaim
func (Keeper) GetMission ¶
GetMission returns a mission from its id
func (Keeper) InitialClaim ¶
func (k Keeper) InitialClaim(c context.Context, req *types.QueryGetInitialClaimRequest) (*types.QueryGetInitialClaimResponse, error)
func (Keeper) InitializeAirdropSupply ¶
InitializeAirdropSupply set the airdrop supply in the store and set the module balance
func (Keeper) Mission ¶
func (k Keeper) Mission(c context.Context, req *types.QueryGetMissionRequest) (*types.QueryGetMissionResponse, error)
func (Keeper) MissionAll ¶
func (k Keeper) MissionAll(c context.Context, req *types.QueryAllMissionRequest) (*types.QueryAllMissionResponse, error)
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 (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (Keeper) RemoveAirdropSupply ¶
RemoveAirdropSupply removes the AirdropSupply from the store
func (Keeper) RemoveClaimRecord ¶
RemoveClaimRecord removes a claimRecord from the store
func (Keeper) RemoveInitialClaim ¶
RemoveInitialClaim removes initialClaim from the store
func (Keeper) RemoveMission ¶
RemoveMission removes a mission from the store
func (Keeper) SetAirdropSupply ¶
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 ¶
SetMission set a specific mission in the store
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