v040

package
v0.45.17 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package v040 is copy-pasted from: https://github.com/cosmos/cosmos-sdk/blob/v0.41.0/x/distribution/types/keys.go

Index

Constants

View Source
const (
	// ModuleName is the module name constant used in many places
	ModuleName = "distribution"

	// StoreKey is the store key string for distribution
	StoreKey = ModuleName

	// RouterKey is the message route for distribution
	RouterKey = ModuleName

	// QuerierRoute is the querier route for distribution
	QuerierRoute = ModuleName
)

Variables

View Source
var (
	FeePoolKey                        = []byte{0x00} // key for global distribution state
	ProposerKey                       = []byte{0x01} // key for the proposer operator address
	ValidatorOutstandingRewardsPrefix = []byte{0x02} // key for outstanding rewards

	DelegatorWithdrawAddrPrefix          = []byte{0x03} // key for delegator withdraw address
	DelegatorStartingInfoPrefix          = []byte{0x04} // key for delegator starting info
	ValidatorHistoricalRewardsPrefix     = []byte{0x05} // key for historical validators rewards / stake
	ValidatorCurrentRewardsPrefix        = []byte{0x06} // key for current validator rewards
	ValidatorAccumulatedCommissionPrefix = []byte{0x07} // key for accumulated validator commission
	ValidatorSlashEventPrefix            = []byte{0x08} // key for validator slash fraction
)

Keys for distribution store Items are stored with the following key: values

- 0x00<proposalID_Bytes>: FeePol

- 0x01: sdk.ConsAddress

- 0x02<valAddr_Bytes>: ValidatorOutstandingRewards

- 0x03<accAddr_Bytes>: sdk.AccAddress

- 0x04<valAddr_Bytes><accAddr_Bytes>: DelegatorStartingInfo

- 0x05<valAddr_Bytes><period_Bytes>: ValidatorHistoricalRewards

- 0x06<valAddr_Bytes>: ValidatorCurrentRewards

- 0x07<valAddr_Bytes>: ValidatorCurrentRewards

- 0x08<valAddr_Bytes><height>: ValidatorSlashEvent

Functions

func GetDelegatorStartingInfoAddresses

func GetDelegatorStartingInfoAddresses(key []byte) (valAddr sdk.ValAddress, delAddr sdk.AccAddress)

gets the addresses from a delegator starting info key

func GetDelegatorStartingInfoKey

func GetDelegatorStartingInfoKey(v sdk.ValAddress, d sdk.AccAddress) []byte

gets the key for a delegator's starting info

func GetDelegatorWithdrawAddrKey

func GetDelegatorWithdrawAddrKey(delAddr sdk.AccAddress) []byte

gets the key for a delegator's withdraw addr

func GetDelegatorWithdrawInfoAddress

func GetDelegatorWithdrawInfoAddress(key []byte) (delAddr sdk.AccAddress)

gets an address from a delegator's withdraw info key

func GetValidatorAccumulatedCommissionAddress

func GetValidatorAccumulatedCommissionAddress(key []byte) (valAddr sdk.ValAddress)

gets the address from a validator's accumulated commission key

func GetValidatorAccumulatedCommissionKey

func GetValidatorAccumulatedCommissionKey(v sdk.ValAddress) []byte

gets the key for a validator's current commission

func GetValidatorCurrentRewardsAddress

func GetValidatorCurrentRewardsAddress(key []byte) (valAddr sdk.ValAddress)

gets the address from a validator's current rewards key

func GetValidatorCurrentRewardsKey

func GetValidatorCurrentRewardsKey(v sdk.ValAddress) []byte

gets the key for a validator's current rewards

func GetValidatorHistoricalRewardsAddressPeriod

func GetValidatorHistoricalRewardsAddressPeriod(key []byte) (valAddr sdk.ValAddress, period uint64)

gets the address & period from a validator's historical rewards key

func GetValidatorHistoricalRewardsKey

func GetValidatorHistoricalRewardsKey(v sdk.ValAddress, k uint64) []byte

gets the key for a validator's historical rewards

func GetValidatorHistoricalRewardsPrefix

func GetValidatorHistoricalRewardsPrefix(v sdk.ValAddress) []byte

gets the prefix key for a validator's historical rewards

func GetValidatorOutstandingRewardsAddress

func GetValidatorOutstandingRewardsAddress(key []byte) (valAddr sdk.ValAddress)

gets an address from a validator's outstanding rewards key

func GetValidatorOutstandingRewardsKey

func GetValidatorOutstandingRewardsKey(valAddr sdk.ValAddress) []byte

gets the outstanding rewards key for a validator

func GetValidatorSlashEventAddressHeight

func GetValidatorSlashEventAddressHeight(key []byte) (valAddr sdk.ValAddress, height uint64)

gets the height from a validator's slash event key

func GetValidatorSlashEventKey

func GetValidatorSlashEventKey(v sdk.ValAddress, height, period uint64) []byte

gets the key for a validator's slash fraction

func GetValidatorSlashEventKeyPrefix

func GetValidatorSlashEventKeyPrefix(v sdk.ValAddress, height uint64) []byte

gets the prefix key for a validator's slash fraction (ValidatorSlashEventPrefix + height)

func GetValidatorSlashEventPrefix

func GetValidatorSlashEventPrefix(v sdk.ValAddress) []byte

gets the prefix key for a validator's slash fractions

func Migrate

func Migrate(oldDistributionState v038distribution.GenesisState) *v040distribution.GenesisState

Migrate accepts exported x/distribution genesis state from v0.38 and migrates it to v0.40 x/distribution genesis state. The migration includes:

- Convert addresses from bytes to bech32 strings. - Re-encode in v0.40 GenesisState.

Types

This section is empty.

Jump to

Keyboard shortcuts

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