keeper

package
v2.0.0-rc6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CampaignCurrentAmountSumCheckInvariant

func CampaignCurrentAmountSumCheckInvariant(k Keeper) sdk.Invariant

CampaignCurrentAmountSumCheckInvariant checks that sum of claim claims left is equal to cfeaidrop module account balance

func CreateFeegrantAccountAddress

func CreateFeegrantAccountAddress(campaignId uint64) (string, sdk.AccAddress)

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 register cfedistribution invariants

Types

type Keeper

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

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey,
	memKey storetypes.StoreKey,

	accountKeeper types.AccountKeeper,
	bankKeeper types.BankKeeper,
	feeGrantKeeper types.FeeGrantKeeper,
	stakingKeeper types.StakingKeeper,
	vestingKeeper types.CfeVestingKeeper,
) *Keeper

func (Keeper) AddClaimRecords

func (k Keeper) AddClaimRecords(ctx sdk.Context, owner string, campaignId uint64, claimRecordEntries []*types.ClaimRecordEntry) error

func (Keeper) AddMission

func (k Keeper) AddMission(ctx sdk.Context, owner string, campaignId uint64, name string, description string, missionType types.MissionType,
	weight sdk.Dec, claimStartDate *time.Time) (*types.Mission, error)

func (Keeper) AllMissionForCampaign

func (k Keeper) AllMissionForCampaign(ctx sdk.Context, campaignId uint64) (list []types.Mission, weightSum sdk.Dec)

AllMissionForCampaign returns all mission for campaign

func (Keeper) AppendNewCampaign

func (k Keeper) AppendNewCampaign(
	ctx sdk.Context,
	campaign types.Campaign,
) uint64

AppendNewCampaign appends a campaign in the store with a new id and update the count

func (Keeper) AppendNewMission

func (k Keeper) AppendNewMission(
	ctx sdk.Context,
	campaignId uint64,
	mission types.Mission,
) uint64

func (Keeper) Campaign

func (Keeper) Campaigns

func (Keeper) Claim

func (k Keeper) Claim(ctx sdk.Context, campaignId uint64, missionId uint64, claimer string) (sdk.Coins, error)

func (Keeper) CloseCampaign

func (k Keeper) CloseCampaign(ctx sdk.Context, owner string, campaignId uint64) error

func (Keeper) CompleteMissionFromHook

func (k Keeper) CompleteMissionFromHook(ctx sdk.Context, campaignId uint64, missionId uint64, address string) error

func (Keeper) CreateCampaign

func (k Keeper) CreateCampaign(ctx sdk.Context, owner string, name string, description string, campaignType types.CampaignType, removableClaimRecords bool,
	feegrantAmount math.Int, initialClaimFreeAmount math.Int, free sdk.Dec, startTime time.Time,
	endTime time.Time, lockupPeriod time.Duration, vestingPeriod time.Duration, vestingPoolName string) (*types.Campaign, error)

func (Keeper) DeleteClaimRecord

func (k Keeper) DeleteClaimRecord(ctx sdk.Context, owner string, campaignId uint64, userAddress string) error

func (Keeper) EnableCampaign

func (k Keeper) EnableCampaign(ctx sdk.Context, owner string, campaignId uint64, startTime *time.Time, endTime *time.Time) error

func (Keeper) GetAccountAddressModuleAccount

func (k Keeper) GetAccountAddressModuleAccount(ctx sdk.Context, accountName string) sdk.AccAddress

func (Keeper) GetAccountCoins

func (k Keeper) GetAccountCoins(ctx sdk.Context, account sdk.AccAddress) sdk.Coins

func (Keeper) GetAccountCoinsForModuleAccount

func (k Keeper) GetAccountCoinsForModuleAccount(ctx sdk.Context, accountName string) sdk.Coins

func (Keeper) GetAllCampaigns

func (k Keeper) GetAllCampaigns(ctx sdk.Context) (list []types.Campaign)

GetAllCampaigns returns all campaignO

func (Keeper) GetAllMission

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

GetAllMission returns all mission

func (Keeper) GetAllMissionCount

func (k Keeper) GetAllMissionCount(ctx sdk.Context) (missionCounts []*types.MissionCount)

GetAllMissionCount returns all mission count

func (Keeper) GetAllUsersEntries

func (k Keeper) GetAllUsersEntries(ctx sdk.Context) (list []types.UserEntry)

GetAllUsersEntries returns all UserEntries

func (Keeper) GetCampaign

func (k Keeper) GetCampaign(
	ctx sdk.Context,
	campaignId uint64,
) (val types.Campaign, found bool)

GetCampaign returns a campaignO from its index

func (Keeper) GetCampaignCount

func (k Keeper) GetCampaignCount(ctx sdk.Context) uint64

func (Keeper) GetMission

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

GetMission returns a mission from its index

func (Keeper) GetMissionCount

func (k Keeper) GetMissionCount(ctx sdk.Context, campaignId uint64) uint64

func (Keeper) GetUserEntry

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

GetUserEntry returns a claimRecordXX from its index

func (Keeper) InitialClaim

func (k Keeper) InitialClaim(ctx sdk.Context, claimer string, campaignId uint64, destinationAddress string) (sdk.Coins, error)

func (Keeper) Logger

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

func (Keeper) MustGetCampaign

func (k Keeper) MustGetCampaign(ctx sdk.Context, campaignId uint64) (*types.Campaign, error)

func (Keeper) MustGetMission

func (k Keeper) MustGetMission(
	ctx sdk.Context,
	campaignId uint64,
	missionId uint64,
) (*types.Mission, error)

MustGetMission returns a mission from its index

func (Keeper) MustGetUserEntry

func (k Keeper) MustGetUserEntry(ctx sdk.Context, userAddress string) (types.UserEntry, error)

func (Keeper) NewMissionDelegationHooks

func (k Keeper) NewMissionDelegationHooks() MissionDelegationHooks

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

func (Keeper) NewMissionVoteHooks

func (k Keeper) NewMissionVoteHooks() MissionVoteHooks

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

func (Keeper) RemoveAllMissionForCampaign

func (k Keeper) RemoveAllMissionForCampaign(ctx sdk.Context, campaignId uint64)

RemoveAllMissionForCampaign removes all mission for campaign

func (Keeper) RemoveCampaign

func (k Keeper) RemoveCampaign(ctx sdk.Context, owner string, campaignId uint64) error

func (Keeper) RemoveMissionCount

func (k Keeper) RemoveMissionCount(ctx sdk.Context, campaignId uint64)

func (Keeper) SetCampaign

func (k Keeper) SetCampaign(ctx sdk.Context, campaign types.Campaign)

SetCampaign set a specific campaignO in the store from its index

func (Keeper) SetCampaignCount

func (k Keeper) SetCampaignCount(ctx sdk.Context, count uint64)

func (Keeper) SetMission

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

SetMission set a specific mission in the store from its index

func (Keeper) SetMissionCount

func (k Keeper) SetMissionCount(ctx sdk.Context, campaignId uint64, count uint64)

func (Keeper) SetUserEntry

func (k Keeper) SetUserEntry(ctx sdk.Context, userEntry types.UserEntry)

SetUserEntry set a specific claimRecordXX in the store from its index

func (Keeper) SetupNewFeegrantAccount

func (k Keeper) SetupNewFeegrantAccount(ctx sdk.Context, campaignId uint64) sdk.AccAddress

func (Keeper) ValidateAddClaimRecords

func (k Keeper) ValidateAddClaimRecords(ctx sdk.Context, owner string, campaignId uint64, claimRecordEntries []*types.ClaimRecordEntry) (*types.Campaign, error)

func (Keeper) ValidateAddMission

func (k Keeper) ValidateAddMission(ctx sdk.Context, owner string, campaignId uint64, name string, description string,
	missionType types.MissionType, weight sdk.Dec, claimStartDate *time.Time) (*types.Campaign, error)

func (Keeper) ValidateCampaignParams

func (k Keeper) ValidateCampaignParams(ctx sdk.Context, name string, description string, feegrantAmount math.Int,
	inititalClaimFreeAmount math.Int, free sdk.Dec, startTime time.Time, endTime time.Time,
	campaignType types.CampaignType, owner string, vestingPoolName string, lockupPeriod time.Duration, vestingPeriod time.Duration) error

func (Keeper) ValidateMissionsWeightAndType

func (k Keeper) ValidateMissionsWeightAndType(ctx sdk.Context, campaignId uint64, newMissionWeight sdk.Dec, missionType types.MissionType) error

func (Keeper) ValidateVestingPoolCampaign

func (k Keeper) ValidateVestingPoolCampaign(ctx sdk.Context, owner string, vestingPoolName string,
	lockupPeriod time.Duration, vestingPeriod time.Duration, free sdk.Dec) error

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(ctx sdk.Context, id uint64) error

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(ctx sdk.Context, valAddr 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