staking

package
v4.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ColumbusChainID = "columbus-5"
)

Variables

This section is empty.

Functions

func NewLegacyQueryServer

func NewLegacyQueryServer(
	originalServer stakingtypes.QueryServer,
	legacySubspace paramtypes.Subspace,
	keeper *keeper.Keeper,
	cdc codec.BinaryCodec,
	storeKey storetypes.StoreKey,
	distrStoreKey storetypes.StoreKey,
) stakingtypes.QueryServer

NewLegacyQueryServer creates a new LegacyQueryServer instance.

`cdc` and `storeKey` are required for the pre-v5-staking-migration ValidatorDelegations fallback path, which uses x/distribution's DelegatorStartingInfo prefix (0x04 || valAddr || delAddr) to enumerate a validator's delegators when staking's reverse-index (0x71) hasn't been backfilled at the queried height.

Types

type AppModule

type AppModule struct {
	staking.AppModule
	// contains filtered or unexported fields
}

AppModule implements an application module for the staking module.

func NewAppModule

NewAppModule creates a new AppModule object

func (AppModule) RegisterServices

func (am AppModule) RegisterServices(cfg module.Configurator)

RegisterServices registers module services.

type AppModuleBasic

type AppModuleBasic struct {
	staking.AppModuleBasic
}

AppModuleBasic defines the basic application module used by the staking module.

func (AppModuleBasic) DefaultGenesis

func (am AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage

DefaultGenesis returns default genesis state as raw bytes for the gov module.

func (AppModuleBasic) RegisterLegacyAminoCodec

func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)

RegisterLegacyAminoCodec registers the staking module's types for the given codec.

type LegacyQueryServer

type LegacyQueryServer struct {
	// Embed the original query server to inherit all methods
	stakingtypes.QueryServer
	// contains filtered or unexported fields
}

LegacyQueryServer wraps the staking QueryServer and sets legacy parameters for pre-upgrade height queries

func (*LegacyQueryServer) Pool

type TerraStakingHooks

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

TerraStakingHooks implements staking hooks to enforce validator power limit

func NewTerraStakingHooks

func NewTerraStakingHooks(sk stakingkeeper.Keeper) *TerraStakingHooks

func (TerraStakingHooks) AfterDelegationModified

func (h TerraStakingHooks) AfterDelegationModified(ctx context.Context, _ sdk.AccAddress, valAddr sdk.ValAddress) error

Other required hook methods with empty implementations

func (TerraStakingHooks) AfterUnbondingInitiated

func (h TerraStakingHooks) AfterUnbondingInitiated(_ context.Context, _ uint64) error

func (TerraStakingHooks) AfterValidatorBeginUnbonding

func (h TerraStakingHooks) AfterValidatorBeginUnbonding(_ context.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error

func (TerraStakingHooks) AfterValidatorBonded

func (h TerraStakingHooks) AfterValidatorBonded(_ context.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error

func (TerraStakingHooks) AfterValidatorCreated

func (h TerraStakingHooks) AfterValidatorCreated(_ context.Context, _ sdk.ValAddress) error

Add this method to TerraStakingHooks

func (TerraStakingHooks) AfterValidatorRemoved

func (h TerraStakingHooks) AfterValidatorRemoved(_ context.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error

func (TerraStakingHooks) BeforeDelegationCreated

func (h TerraStakingHooks) BeforeDelegationCreated(_ context.Context, _ sdk.AccAddress, _ sdk.ValAddress) error

Implement required staking hooks interface methods

func (TerraStakingHooks) BeforeDelegationRemoved

func (h TerraStakingHooks) BeforeDelegationRemoved(_ context.Context, _ sdk.AccAddress, _ sdk.ValAddress) error

Add the missing method

func (TerraStakingHooks) BeforeDelegationSharesModified

func (h TerraStakingHooks) BeforeDelegationSharesModified(_ context.Context, _ sdk.AccAddress, _ sdk.ValAddress) error

func (TerraStakingHooks) BeforeValidatorModified

func (h TerraStakingHooks) BeforeValidatorModified(_ context.Context, _ sdk.ValAddress) error

func (TerraStakingHooks) BeforeValidatorSlashed

func (h TerraStakingHooks) BeforeValidatorSlashed(_ context.Context, _ sdk.ValAddress, _ math.LegacyDec) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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