keeper

package
v30.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(k Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the x/cw-hooks MsgServer interface.

func NewQueryServerImpl

func NewQueryServerImpl(k Keeper) types.QueryServer

Types

type Delegation

type Delegation struct {
	ValidatorAddress string `json:"validator_address"`
	DelegatorAddress string `json:"delegator_address"`
	Shares           string `json:"shares"`
}

func NewDelegation

func NewDelegation(del stakingtypes.DelegationI) *Delegation

type GovHooks

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

func (GovHooks) AfterProposalDeposit

func (h GovHooks) AfterProposalDeposit(ctx context.Context, proposalID uint64, _ sdk.AccAddress) error

func (GovHooks) AfterProposalFailedMinDeposit

func (GovHooks) AfterProposalFailedMinDeposit(_ context.Context, _ uint64) error

func (GovHooks) AfterProposalSubmission

func (h GovHooks) AfterProposalSubmission(ctx context.Context, proposalID uint64) error

func (GovHooks) AfterProposalVote

func (h GovHooks) AfterProposalVote(ctx context.Context, proposalID uint64, voterAddr sdk.AccAddress) error

func (GovHooks) AfterProposalVotingPeriodEnded

func (h GovHooks) AfterProposalVotingPeriodEnded(ctx context.Context, proposalID uint64) error

type Keeper

type Keeper struct {
	Schema collections.Schema
	Params collections.Item[types.Params]

	Contracts *collections.IndexedMap[collections.Pair[[]byte, sdk.AccAddress], types.ContractInfo, contractIndexes]
	// contains filtered or unexported fields
}

func (Keeper) DeleteContract

func (k Keeper) DeleteContract(ctx context.Context, key collections.Prefix, contractAddr sdk.AccAddress) error

func (Keeper) ExecuteMessageOnContracts

func (k Keeper) ExecuteMessageOnContracts(ctx context.Context, key collections.Prefix, msgBz []byte) error

func (Keeper) ExportGenesis

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

ExportGenesis export module state

func (Keeper) GetAllContracts

func (k Keeper) GetAllContracts(ctx context.Context, key collections.Prefix) (list []types.ContractInfo, err error)

func (Keeper) GetAuthority

func (k Keeper) GetAuthority() string

GetAuthority returns the x/cw-hooks module's authority.

func (Keeper) GetCdc

func (k Keeper) GetCdc() codec.BinaryCodec

func (Keeper) GetContractKeeper

func (k Keeper) GetContractKeeper() wasmtypes.ContractOpsKeeper

GetContractKeeper returns the x/wasm module's contract keeper.

func (Keeper) GetParams

func (k Keeper) GetParams(ctx context.Context) (p types.Params)

GetParams returns the current x/cw-hooks module parameters.

func (Keeper) GetStakingKeeper

func (k Keeper) GetStakingKeeper() stakingkeeper.Keeper

func (Keeper) GetStoreService

func (k Keeper) GetStoreService() storetypes.KVStoreService

func (Keeper) GetWasmKeeper

func (k Keeper) GetWasmKeeper() wasmkeeper.Keeper

func (Keeper) GovHooks

func (k Keeper) GovHooks() GovHooks

func (Keeper) InitGenesis

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

InitGenesis import module genesis

func (Keeper) IsContractRegistered

func (k Keeper) IsContractRegistered(ctx context.Context, key collections.Prefix, contractAddr sdk.AccAddress) (bool, error)

func (Keeper) Logger

func (Keeper) Logger(ctx context.Context) log.Logger

Logger returns a module-specific logger.

func (Keeper) SetContract

func (k Keeper) SetContract(ctx context.Context, key collections.Prefix, info types.ContractInfo) error

func (Keeper) SetParams

func (k Keeper) SetParams(ctx context.Context, p types.Params) error

SetParams sets the x/cw-hooks module parameters.

func (Keeper) StakingHooks

func (k Keeper) StakingHooks() StakingHooks

StakingHooks creates new hooks for the staking module

type Proposal

type Proposal struct {
	ProposalID uint64 `json:"proposal_id"`
	Proposer   string `json:"proposer"`
	Status     uint   `json:"status"`
	SubmitTime string `json:"submit_time"`
	Metadata   string `json:"metadata"`
	Title      string `json:"title"`
	Summary    string `json:"summary"`
}

func NewProposal

func NewProposal(prop v1.Proposal) Proposal

type StakingHooks

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

func (StakingHooks) AfterDelegationModified

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

AfterDelegationModified is a hook that runs AFTER any user redelegates/unstakes from a validator

func (StakingHooks) AfterUnbondingInitiated

func (StakingHooks) AfterUnbondingInitiated(_ context.Context, _ uint64) error

func (StakingHooks) AfterValidatorBeginUnbonding

func (h StakingHooks) AfterValidatorBeginUnbonding(ctx context.Context, _ sdk.ConsAddress, valAddr sdk.ValAddress) error

func (StakingHooks) AfterValidatorBonded

func (h StakingHooks) AfterValidatorBonded(ctx context.Context, _ sdk.ConsAddress, valAddr sdk.ValAddress) error

func (StakingHooks) AfterValidatorCreated

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

AfterValidatorCreated is a hook that runs after anyone registers as a new validator

func (StakingHooks) AfterValidatorRemoved

func (h StakingHooks) AfterValidatorRemoved(ctx context.Context, _ sdk.ConsAddress, valAddr sdk.ValAddress) error

AfterValidatorRemoved is a hook that runs after anyone deletes their validator

func (StakingHooks) BeforeDelegationCreated

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

BeforeDelegationCreated is a hook that runs BEFORE any user stakes some tokens

func (StakingHooks) BeforeDelegationRemoved

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

BeforeDelegationRemoved is a hook that runs BEFORE a user claims their unstaked tokens back

func (StakingHooks) BeforeDelegationSharesModified

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

BeforeDelegationSharesModified that runs BEFORE we update the staked amount for a user in a validator

func (StakingHooks) BeforeValidatorModified

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

BeforeValidatorModified is a hook that runs BEFORE a validator updates their validator configuration

func (StakingHooks) BeforeValidatorSlashed

func (h StakingHooks) BeforeValidatorSlashed(ctx context.Context, valAddr sdk.ValAddress, fraction sdkmath.LegacyDec) error

BeforeValidatorSlashed is a hook that runs right BEFORE a validator is slashed for misbehaviour

type SudoAfterProposalVotingPeriodEnded

type SudoAfterProposalVotingPeriodEnded struct {
	AfterProposalVotingPeriodEnded string `json:"after_proposal_voting_period_ended"`
}

type SudoMsgAfterDelegationModified

type SudoMsgAfterDelegationModified struct {
	AfterDelegationModified *Delegation `json:"after_delegation_modified"`
}

type SudoMsgAfterProposalDeposit

type SudoMsgAfterProposalDeposit struct {
	AfterProposalDeposit Proposal `json:"after_proposal_deposit"`
}

type SudoMsgAfterProposalSubmission

type SudoMsgAfterProposalSubmission struct {
	AfterProposalSubmission Proposal `json:"after_proposal_submission"`
}

type SudoMsgAfterProposalVote

type SudoMsgAfterProposalVote struct {
	AfterProposalVote Vote `json:"after_proposal_vote"`
}

type SudoMsgAfterValidatorBeginUnbonding

type SudoMsgAfterValidatorBeginUnbonding struct {
	AfterValidatorBeginUnbonding *Validator `json:"after_validator_begin_unbonding"`
}

type SudoMsgAfterValidatorBonded

type SudoMsgAfterValidatorBonded struct {
	AfterValidatorBonded *Validator `json:"after_validator_bonded"`
}

type SudoMsgAfterValidatorCreated

type SudoMsgAfterValidatorCreated struct {
	AfterValidatorCreated *Validator `json:"after_validator_created"`
}

type SudoMsgAfterValidatorModified

type SudoMsgAfterValidatorModified struct {
	AfterValidatorModified *Validator `json:"after_validator_modified"`
}

type SudoMsgAfterValidatorRemoved

type SudoMsgAfterValidatorRemoved struct {
	AfterValidatorRemoved *Validator `json:"after_validator_removed"`
}

type SudoMsgBeforeDelegationCreated

type SudoMsgBeforeDelegationCreated struct {
	BeforeDelegationCreated *Delegation `json:"before_delegation_created"`
}

type SudoMsgBeforeDelegationRemoved

type SudoMsgBeforeDelegationRemoved struct {
	BeforeDelegationRemoved *Delegation `json:"before_delegation_removed"`
}

type SudoMsgBeforeDelegationSharesModified

type SudoMsgBeforeDelegationSharesModified struct {
	BeforeDelegationSharesModified *Delegation `json:"before_delegation_shares_modified"`
}

type SudoMsgBeforeValidatorModified

type SudoMsgBeforeValidatorModified struct {
	BeforeValidatorModified *Validator `json:"before_validator_modified"`
}

type SudoMsgBeforeValidatorSlashed

type SudoMsgBeforeValidatorSlashed struct {
	BeforeValidatorSlashed *ValidatorSlashed `json:"before_validator_slashed"`
}

type Validator

type Validator struct {
	Moniker          string `json:"moniker"`
	ValidatorAddress string `json:"validator_address"`
	Commission       string `json:"commission"`
	ValidatorTokens  string `json:"validator_tokens"`
	BondedTokens     string `json:"bonded_tokens"`
	BondStatus       string `json:"bond_status"`
}

func NewValidator

func NewValidator(val stakingtypes.ValidatorI) *Validator

type ValidatorSlashed

type ValidatorSlashed struct {
	Moniker          string `json:"moniker"`
	ValidatorAddress string `json:"validator_address"`
	SlashedAmount    string `json:"slashed_amount"`
}

func NewValidatorSlashed

func NewValidatorSlashed(val stakingtypes.ValidatorI, fraction sdkmath.LegacyDec) *ValidatorSlashed

type Vote

type Vote struct {
	ProposalID   uint64                   `json:"proposal_id"`
	VoterAddress string                   `json:"voter_address"`
	VoteOption   []*v1.WeightedVoteOption `json:"vote_option"`
}

func NewVote

func NewVote(vote v1.Vote) Vote

Jump to

Keyboard shortcuts

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