keeper

package
v28.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: Apache-2.0 Imports: 24 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 (h 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 {
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	ss storetypes.KVStoreService,
	stakingKeeper stakingkeeper.Keeper,
	govKeeper govkeeper.Keeper,
	wasmkeeper wasmkeeper.Keeper,
	contractKeeper wasmtypes.ContractOpsKeeper,
	authority string,
) Keeper

func (Keeper) DeleteContract

func (k Keeper) DeleteContract(ctx context.Context, keyPrefix []byte, contractAddr sdk.AccAddress)

func (Keeper) ExecuteMessageOnContracts

func (k Keeper) ExecuteMessageOnContracts(ctx context.Context, keyPrefix []byte, 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, keyPrefix []byte) (list []sdk.Address)

func (Keeper) GetAllContractsBech32

func (k Keeper) GetAllContractsBech32(ctx context.Context, keyPrefix []byte) []string

func (Keeper) GetAuthority

func (k Keeper) GetAuthority() string

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

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) 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, keyPrefix []byte, contractAddr sdk.AccAddress) bool

func (Keeper) IterateContracts

func (k Keeper) IterateContracts(
	ctx context.Context,
	keyPrefix []byte,
	handlerFn func(contractAddr []byte) (stop bool),
)

func (Keeper) Logger

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

Logger returns a module-specific logger.

func (Keeper) SetContract

func (k Keeper) SetContract(ctx context.Context, keyPrefix []byte, contractAddr sdk.AccAddress)

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

Create new distribution hooks

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

create new delegation period record

func (StakingHooks) AfterUnbondingInitiated

func (h 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

initialize validator distribution record

func (StakingHooks) AfterValidatorRemoved

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

AfterValidatorRemoved performs clean up after a validator is removed

func (StakingHooks) BeforeDelegationCreated

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

increment period

func (StakingHooks) BeforeDelegationRemoved

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

func (StakingHooks) BeforeDelegationSharesModified

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

withdraw delegation rewards (which also increments period)

func (StakingHooks) BeforeValidatorModified

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

func (StakingHooks) BeforeValidatorSlashed

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

record the slash event

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"`
}

Validators

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"`
}

Delegations

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