keeper

package
v15.0.0-testnet Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AreAllTrue

func AreAllTrue(bools []bool) bool

func CurrentAirdropRound

func CurrentAirdropRound(start time.Time) int

func GetAirdropDurationForAction

func GetAirdropDurationForAction(action types.Action) int64

Get airdrop duration for action

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

Types

type Hooks

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

Hooks wrapper struct for claim keeper

func (Hooks) AfterDelegationModified

func (h Hooks) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error

func (Hooks) AfterEpochEnd

func (h Hooks) AfterEpochEnd(ctx sdk.Context, epochInfo epochstypes.EpochInfo)

func (Hooks) AfterLiquidStake

func (h Hooks) AfterLiquidStake(ctx sdk.Context, addr sdk.AccAddress)

ibcstaking hooks

func (Hooks) AfterUnbondingInitiated

func (h Hooks) AfterUnbondingInitiated(ctx sdk.Context, id uint64) error

func (Hooks) AfterValidatorBeginUnbonding

func (h Hooks) AfterValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error

func (Hooks) AfterValidatorBonded

func (h Hooks) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error

func (Hooks) AfterValidatorCreated

func (h Hooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) error

staking hooks

func (Hooks) AfterValidatorRemoved

func (h Hooks) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error

func (Hooks) BeforeDelegationCreated

func (h Hooks) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error

func (Hooks) BeforeDelegationRemoved

func (h Hooks) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error

func (Hooks) BeforeDelegationSharesModified

func (h Hooks) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error

func (Hooks) BeforeEpochStart

func (h Hooks) BeforeEpochStart(ctx sdk.Context, epochInfo epochstypes.EpochInfo)

epochs hooks

func (Hooks) BeforeSlashingRedelegation

func (h Hooks) BeforeSlashingRedelegation(ctx sdk.Context, srcValidator stakingtypes.Validator, redelegation stakingtypes.Redelegation,
	infractionHeight int64, slashFactor sdk.Dec) error

func (Hooks) BeforeSlashingUnbondingDelegation

func (h Hooks) BeforeSlashingUnbondingDelegation(ctx sdk.Context, unbondingDelegation stakingtypes.UnbondingDelegation,
	infractionHeight int64, slashFactor sdk.Dec) error

func (Hooks) BeforeValidatorModified

func (h Hooks) BeforeValidatorModified(ctx sdk.Context, valAddr sdk.ValAddress) error

func (Hooks) BeforeValidatorSlashed

func (h Hooks) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec) error

type Keeper

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

Keeper struct

func NewKeeper

NewKeeper returns keeper

func (Keeper) AfterClaim

func (k Keeper) AfterClaim(ctx sdk.Context, airdropIdentifier string, claimAmount sdkmath.Int) error

func (Keeper) AfterDelegationModified

func (k Keeper) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error

func (Keeper) AfterEpochEnd

func (k Keeper) AfterEpochEnd(ctx sdk.Context, epochInfo epochstypes.EpochInfo)

func (Keeper) AfterLiquidStake

func (k Keeper) AfterLiquidStake(ctx sdk.Context, addr sdk.AccAddress)

func (Keeper) BeforeEpochStart

func (k Keeper) BeforeEpochStart(ctx sdk.Context, epochInfo epochstypes.EpochInfo)

func (Keeper) ClaimAllCoinsForAction

func (k Keeper) ClaimAllCoinsForAction(ctx sdk.Context, addr sdk.AccAddress, action types.Action) (sdk.Coins, error)

func (Keeper) ClaimCoinsForAction

func (k Keeper) ClaimCoinsForAction(ctx sdk.Context, addr sdk.AccAddress, action types.Action, airdropIdentifier string) (sdk.Coins, error)

ClaimCoins remove claimable amount entry and transfer it to user's account

func (Keeper) ClaimMetadata

ClaimMetadata returns all vestings for user

func (Keeper) ClaimRecord

ClaimRecord returns user claim record by address and airdrop identifier

func (Keeper) ClaimStatus

ClaimStatus returns all vestings for user

func (Keeper) ClaimableForAction

ClaimableForAction returns claimable amount per action

func (Keeper) CreateAirdropAndEpoch

func (k Keeper) CreateAirdropAndEpoch(ctx sdk.Context, msg types.MsgCreateAirdrop) error

CreateAirdropAndEpoch creates a new airdrop and epoch for that.

func (Keeper) DeleteAirdropAndEpoch

func (k Keeper) DeleteAirdropAndEpoch(ctx sdk.Context, identifier string) error

DeleteAirdropAndEpoch deletes existing airdrop and corresponding epoch.

func (Keeper) DeleteClaimRecord

func (k Keeper) DeleteClaimRecord(ctx sdk.Context, addr sdk.AccAddress, airdropId string) error

func (Keeper) DeleteTotalWeight

func (k Keeper) DeleteTotalWeight(ctx sdk.Context, airdropIdentifier string)

DeleteTotalWeight deletes total weights for airdrop

func (Keeper) DistributorAccountBalance

Params returns balances of the distributor account

func (Keeper) EndAirdrop

func (k Keeper) EndAirdrop(ctx sdk.Context, airdropIdentifier string) error

EndAirdrop ends airdrop and clear all user claim records

func (Keeper) EndBlocker

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

Endblocker handler

func (Keeper) ExportGenesis

func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState

ExportGenesis returns the capability module's exported genesis.

func (Keeper) GetAirdropByChainId

func (k Keeper) GetAirdropByChainId(ctx sdk.Context, chainId string) (airdrop *types.Airdrop, found bool)

Get airdrop by chain id

func (Keeper) GetAirdropByDistributor

func (k Keeper) GetAirdropByDistributor(ctx sdk.Context, distributor string) *types.Airdrop

Get airdrop by distributor

func (Keeper) GetAirdropByIdentifier

func (k Keeper) GetAirdropByIdentifier(ctx sdk.Context, airdropIdentifier string) *types.Airdrop

Get airdrop by identifier

func (Keeper) GetAirdropClaimDenom

func (k Keeper) GetAirdropClaimDenom(ctx sdk.Context, airdropIdentifier string) (string, error)

Get airdrop claim denom

func (Keeper) GetAirdropDistributor

func (k Keeper) GetAirdropDistributor(ctx sdk.Context, airdropIdentifier string) (sdk.AccAddress, error)

Get airdrop distributor address

func (Keeper) GetAirdropIdentifiersForUser

func (k Keeper) GetAirdropIdentifiersForUser(ctx sdk.Context, addr sdk.AccAddress) []string

Get airdrop identifier corresponding to the user address

func (Keeper) GetAirdropIds

func (k Keeper) GetAirdropIds(ctx sdk.Context) []string

func (Keeper) GetClaimMetadata

func (k Keeper) GetClaimMetadata(ctx sdk.Context) []types.ClaimMetadata

GetClaimMetadata returns all claim status associated with the user account

func (Keeper) GetClaimRecord

func (k Keeper) GetClaimRecord(ctx sdk.Context, addr sdk.AccAddress, airdropIdentifier string) (types.ClaimRecord, error)

GetClaimRecord returns the claim record for a specific address

func (Keeper) GetClaimRecords

func (k Keeper) GetClaimRecords(ctx sdk.Context, airdropIdentifier string) []types.ClaimRecord

GetClaimables get claimables for genesis export

func (Keeper) GetClaimStatus

func (k Keeper) GetClaimStatus(ctx sdk.Context, addr sdk.AccAddress) ([]types.ClaimStatus, error)

GetClaimStatus returns all claim status associated with the user account

func (Keeper) GetClaimableAmountForAction

func (k Keeper) GetClaimableAmountForAction(ctx sdk.Context, addr sdk.AccAddress, action types.Action, airdropIdentifier string, includeClaimed bool) (sdk.Coins, error)

GetClaimable returns claimable amount for a specific action done by an address

func (Keeper) GetDistributorAccountBalance

func (k Keeper) GetDistributorAccountBalance(ctx sdk.Context, airdropIdentifier string) (sdk.Coin, error)

GetDistributorAccountBalance gets the airdrop coin balance of module account

func (Keeper) GetParams

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

GetParams get params

func (Keeper) GetTotalWeight

func (k Keeper) GetTotalWeight(ctx sdk.Context, airdropIdentifier string) (sdk.Dec, error)

GetTotalWeight gets total sum of user weights in store

func (Keeper) GetUnallocatedUsers

func (k Keeper) GetUnallocatedUsers(ctx sdk.Context, identifier string, users []string, weights []sdk.Dec) ([]string, []sdk.Dec)

Remove duplicated airdrops for given params

func (Keeper) GetUserTotalClaimable

func (k Keeper) GetUserTotalClaimable(ctx sdk.Context, addr sdk.AccAddress, airdropIdentifier string, includeClaimed bool) (sdk.Coins, error)

GetClaimable returns claimable amount for a specific action done by an address

func (Keeper) GetUserVestings

func (k Keeper) GetUserVestings(ctx sdk.Context, addr sdk.AccAddress) (vestingtypes.Periods, sdk.Coins)

GetUserVestings returns all vestings associated to the user account

func (Keeper) Hooks

func (k Keeper) Hooks() Hooks

Return the wrapper struct

func (Keeper) IncrementClaimedSoFar

func (k Keeper) IncrementClaimedSoFar(ctx sdk.Context, identifier string, amount sdkmath.Int) error

IncrementClaimedSoFar increments ClaimedSoFar for a single airdrop

func (Keeper) InitGenesis

func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState)

InitGenesis initializes the capability module's state from a provided genesis state.

func (Keeper) IsInitialPeriodPassed

func (k Keeper) IsInitialPeriodPassed(ctx sdk.Context, airdropIdentifier string) bool

func (Keeper) LoadAllocationData

func (k Keeper) LoadAllocationData(ctx sdk.Context, allocationData string) bool

func (Keeper) Logger

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

Logger returns logger

func (Keeper) Params

Params returns params of the claim module.

func (Keeper) ResetClaimStatus

func (k Keeper) ResetClaimStatus(ctx sdk.Context, airdropIdentifier string) error

ResetClaimStatus clear users' claimed status only after initial period of vesting is passed

func (Keeper) ResetClaimedSoFar

func (k Keeper) ResetClaimedSoFar(ctx sdk.Context, airdropIdentifier string) error

ResetClaimedSoFar resets ClaimedSoFar for a all airdrops

func (Keeper) SetClaimRecord

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

SetClaimRecord sets a claim record for an address in store

func (Keeper) SetClaimRecords

func (k Keeper) SetClaimRecords(ctx sdk.Context, claimRecords []types.ClaimRecord) error

SetClaimRecords set claim records and total weights

func (Keeper) SetClaimRecordsWithWeights

func (k Keeper) SetClaimRecordsWithWeights(ctx sdk.Context, claimRecords []types.ClaimRecord) error

func (Keeper) SetParams

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

SetParams set params

func (Keeper) SetTotalWeight

func (k Keeper) SetTotalWeight(ctx sdk.Context, totalWeight sdk.Dec, airdropIdentifier string)

SetTotalWeight sets total sum of user weights in store

func (Keeper) TotalClaimable

TotalClaimable returns total claimable amount for user

func (Keeper) UpdateAirdropAddress

func (k Keeper) UpdateAirdropAddress(ctx sdk.Context, existingStrideAddress string, newStrideAddress string, airdropId string) error

func (Keeper) UserVestings

UserVestings returns all vestings for user

Jump to

Keyboard shortcuts

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