staking

package
v2.0.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package staking defines a "wrapper" module around the Cosmos SDK's native x/staking module. In other words, it provides the exact same functionality as the native module in that it simply embeds the native module. However, it overrides two core methods, `InitGenesis` and `EndBlock`. Specifically, these methods perform no-ops and return no validator set updates, as validator sets are tracked by the consumer chain's x/ccv/consumer module.

The consumer chain should utilize the x/ccv/democracy/staking module to perform democratic actions such as participating and voting within the chain's governance system.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppModule

type AppModule struct {
	// embed the Cosmos SDK's x/staking AppModule
	staking.AppModule
	// contains filtered or unexported fields
}

AppModule embeds the Cosmos SDK's x/staking AppModule where we only override specific methods.

func NewAppModule

func NewAppModule(cdc codec.Codec, keeper keeper.Keeper, ak types.AccountKeeper, bk types.BankKeeper) AppModule

NewAppModule creates a new AppModule object using the native x/staking module AppModule constructor.

func (AppModule) EndBlock

EndBlock delegates the EndBlock call to the underlying x/staking module, however, it returns no validator updates as validators are tracked via the consumer chain's x/cvv/consumer module and so this module is not responsible for returning the initial validator set.

Note: This method does not require any special handling for PreCCV being true (as a part of the changeover from standalone -> consumer chain). The ccv consumer Endblocker is ordered to run before the staking Endblocker, so if PreCCV is true during one block, the ccv consumer Enblocker will return the proper validator updates, the PreCCV flag will be toggled to false, and no validator updates should be returned by this method.

func (AppModule) InitGenesis

func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate

InitGenesis delegates the InitGenesis call to the underlying x/staking module, however, it returns no validator updates as validators are tracked via the consumer chain's x/cvv/consumer module and so this module is not responsible for returning the initial validator set.

Note: InitGenesis is not called during the soft upgrade of a module (as a part of a changeover from standalone -> consumer chain), so there is no special handling needed in this method for a consumer being in the pre-CCV state.

type AppModuleBasic

type AppModuleBasic struct {
	staking.AppModuleBasic
}

AppModule embeds the Cosmos SDK's x/staking AppModuleBasic.

Jump to

Keyboard shortcuts

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