keeper

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2022 License: Apache-2.0 Imports: 27 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hooks

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

Hooks wrapper struct for the claim keeper

func (Hooks) AfterDelegationModified

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

func (Hooks) AfterProposalActive

func (h Hooks) AfterProposalActive(ctx sdk.Context, proposalID uint64)

func (Hooks) AfterProposalDeposit

func (h Hooks) AfterProposalDeposit(ctx sdk.Context, proposalID uint64, depositorAddr sdk.AccAddress)

func (Hooks) AfterProposalFailedMinDeposit

func (h Hooks) AfterProposalFailedMinDeposit(ctx sdk.Context, proposalID uint64)

governance hooks

func (Hooks) AfterProposalInactive

func (h Hooks) AfterProposalInactive(ctx sdk.Context, proposalID uint64)

func (Hooks) AfterProposalSubmission

func (h Hooks) AfterProposalSubmission(ctx sdk.Context, proposalID uint64)

func (Hooks) AfterProposalVote

func (h Hooks) AfterProposalVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.AccAddress)

func (Hooks) AfterProposalVotingPeriodEnded

func (h Hooks) AfterProposalVotingPeriodEnded(ctx sdk.Context, proposalID uint64)

func (Hooks) AfterValidatorBeginUnbonding

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

func (Hooks) AfterValidatorBonded

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

func (Hooks) AfterValidatorCreated

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

func (Hooks) AfterValidatorRemoved

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

func (Hooks) BeforeDelegationCreated

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

func (Hooks) BeforeDelegationRemoved

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

func (Hooks) BeforeDelegationSharesModified

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

func (Hooks) BeforeValidatorModified

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

func (Hooks) BeforeValidatorSlashed

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

func (Hooks) PostTxProcessing

func (h Hooks) PostTxProcessing(ctx sdk.Context, from common.Address, to *common.Address, receipt *ethtypes.Receipt) error

evm hook

func (Hooks) SendPacket

func (h Hooks) SendPacket(ctx sdk.Context, channelCap *capabilitytypes.Capability, packet exported.PacketI) error

SendPacket implements the ICS4Wrapper interface from the transfer module. It calls the underlying SendPacket function directly to move down the middleware stack.

type Keeper

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

Keeper struct

func NewKeeper

NewKeeper returns keeper

func (Keeper) AfterDelegationModified

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

func (Keeper) AfterEVMStateTransition

func (k Keeper) AfterEVMStateTransition(ctx sdk.Context, from common.Address, to *common.Address, receipt *ethtypes.Receipt) error

func (Keeper) AfterProposalVote

func (k Keeper) AfterProposalVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.AccAddress)

func (Keeper) ClaimCoinsForAction

func (k Keeper) ClaimCoinsForAction(
	ctx sdk.Context,
	addr sdk.AccAddress,
	claimsRecord types.ClaimsRecord,
	action types.Action,
	params types.Params,
) (sdk.Int, error)

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

func (Keeper) ClaimsRecord

ClaimsRecord returns initial claimable amount per user and the claims per action

func (Keeper) ClaimsRecords

ClaimsRecords returns all the the claimable records

func (Keeper) ClawbackEmptyAccounts

func (k Keeper) ClawbackEmptyAccounts(ctx sdk.Context, claimsDenom string)

ClawbackEmptyAccounts performs the a clawback off all the allocated tokens from airdrop recipient accounts with a sequence number of 0 (i.e the account hasn't performed a single tx during the claim window). Once the account is clawbacked, the claim record is deleted from state.

func (Keeper) ClawbackEscrowedTokens

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

ClawbackEscrowedTokens transfers all the escrowed airdrop tokens on the ModuleAccount to the community pool.

func (Keeper) DeleteClaimsRecord

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

DeleteClaimsRecord deletes a claim record from the store

func (Keeper) EndAirdrop

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

EndAirdrop transfers the unclaimed tokens from the airdrop to the community pool, then clears the state by removing all the entries

func (Keeper) EndBlocker

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

EndBlocker checks if the airdrop claiming period has ended

func (Keeper) GetClaimableAmountForAction

func (k Keeper) GetClaimableAmountForAction(
	ctx sdk.Context,
	claimsRecord types.ClaimsRecord,
	action types.Action,
	params types.Params,
) sdk.Int

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

func (Keeper) GetClaimsRecord

func (k Keeper) GetClaimsRecord(ctx sdk.Context, addr sdk.AccAddress) (types.ClaimsRecord, bool)

GetClaimsRecord returns the claim record for a specific address

func (Keeper) GetClaimsRecords

func (k Keeper) GetClaimsRecords(ctx sdk.Context) []types.ClaimsRecordAddress

GetClaimsRecords get claimables for genesis export

func (Keeper) GetModuleAccountAccount

func (k Keeper) GetModuleAccountAccount(ctx sdk.Context) authtypes.ModuleAccountI

GetModuleAccountAccount returns the module account for the claim module

func (Keeper) GetModuleAccountAddress

func (k Keeper) GetModuleAccountAddress(ctx sdk.Context) sdk.AccAddress

GetModuleAccountAddress gets the airdrop coin balance of module account

func (Keeper) GetModuleAccountBalances

func (k Keeper) GetModuleAccountBalances(ctx sdk.Context) sdk.Coins

GetModuleAccountBalances gets the balances of module account that escrows the airdrop tokens

func (Keeper) GetParams

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

GetParams returns the total set of claim parameters.

func (Keeper) GetUserTotalClaimable

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

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

func (Keeper) Hooks

func (k Keeper) Hooks() Hooks

Return the wrapper struct

func (Keeper) IterateClaimsRecords

func (k Keeper) IterateClaimsRecords(ctx sdk.Context, handlerFn func(addr sdk.AccAddress, cr types.ClaimsRecord) (stop bool))

func (Keeper) Logger

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

Logger returns logger

func (Keeper) MergeClaimsRecords

func (k Keeper) MergeClaimsRecords(
	ctx sdk.Context,
	recipient sdk.AccAddress,
	senderClaimsRecord,
	recipientClaimsRecord types.ClaimsRecord,
	params types.Params,
) (mergedRecord types.ClaimsRecord, err error)

MergeClaimsRecords merges two claim records from the sender and recipient of the IBC transfer while claiming the amount for the all the sender actions on behalf of the recipient.

func (Keeper) OnAcknowledgementPacket

func (k Keeper) OnAcknowledgementPacket(
	ctx sdk.Context,
	packet channeltypes.Packet,
	acknowledgement []byte,
) error

OnAcknowledgementPacket claims the amount from the `ActionIBCTransfer` for the sender of the IBC transfer. The function performs a no-op if claims are disabled globally, acknowledgment failed, or if sender the sender has no claims record.

func (Keeper) OnRecvPacket

OnRecvPacket performs an IBC receive callback. It performs a no-op if claims are inactive

func (Keeper) Params

Params returns params of the claim module.

func (Keeper) SetClaimsRecord

func (k Keeper) SetClaimsRecord(ctx sdk.Context, addr sdk.AccAddress, claimsRecord types.ClaimsRecord)

SetClaimsRecord sets a claim record for an address in store

func (Keeper) SetParams

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

SetParams sets the claim parameters to the param space.

func (Keeper) TotalUnclaimed

TotalUnclaimed returns the total amount unclaimed from the airdrop.

type Migrator added in v1.1.2

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

Migrator is a struct for handling in-place store migrations.

func NewMigrator added in v1.1.2

func NewMigrator(keeper Keeper) Migrator

NewMigrator returns a new Migrator.

func (Migrator) Migrate1to2 added in v1.1.2

func (m Migrator) Migrate1to2(ctx sdk.Context) error

Migrate1to2 migrates from consensus version 1 to 2.

Jump to

Keyboard shortcuts

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