v040

package
v0.45.13-rc.1 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

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

Index

Constants

View Source
const (
	// ModuleName is the name of the module
	ModuleName = "gov"

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

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

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

Variables

View Source
var (
	ProposalsKeyPrefix          = []byte{0x00}
	ActiveProposalQueuePrefix   = []byte{0x01}
	InactiveProposalQueuePrefix = []byte{0x02}
	ProposalIDKey               = []byte{0x03}

	DepositsKeyPrefix = []byte{0x10}

	VotesKeyPrefix = []byte{0x20}
)

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

- 0x00<proposalID_Bytes>: Proposal

- 0x01<endTime_Bytes><proposalID_Bytes>: activeProposalID

- 0x02<endTime_Bytes><proposalID_Bytes>: inactiveProposalID

- 0x03: nextProposalID

- 0x10<proposalID_Bytes><depositorAddr_Bytes>: Deposit

- 0x20<proposalID_Bytes><voterAddr_Bytes>: Voter

Functions

func ActiveProposalByTimeKey added in v0.43.0

func ActiveProposalByTimeKey(endTime time.Time) []byte

ActiveProposalByTimeKey gets the active proposal queue key by endTime

func ActiveProposalQueueKey added in v0.43.0

func ActiveProposalQueueKey(proposalID uint64, endTime time.Time) []byte

ActiveProposalQueueKey returns the key for a proposalID in the activeProposalQueue

func DepositKey added in v0.43.0

func DepositKey(proposalID uint64, depositorAddr sdk.AccAddress) []byte

DepositKey key of a specific deposit from the store

func DepositsKey added in v0.43.0

func DepositsKey(proposalID uint64) []byte

DepositsKey gets the first part of the deposits key based on the proposalID

func GetProposalIDBytes added in v0.43.0

func GetProposalIDBytes(proposalID uint64) (proposalIDBz []byte)

GetProposalIDBytes returns the byte representation of the proposalID

func GetProposalIDFromBytes added in v0.43.0

func GetProposalIDFromBytes(bz []byte) (proposalID uint64)

GetProposalIDFromBytes returns proposalID in uint64 format from a byte array

func InactiveProposalByTimeKey added in v0.43.0

func InactiveProposalByTimeKey(endTime time.Time) []byte

InactiveProposalByTimeKey gets the inactive proposal queue key by endTime

func InactiveProposalQueueKey added in v0.43.0

func InactiveProposalQueueKey(proposalID uint64, endTime time.Time) []byte

InactiveProposalQueueKey returns the key for a proposalID in the inactiveProposalQueue

func Migrate

func Migrate(oldGovState v036gov.GenesisState) *v040gov.GenesisState

Migrate accepts exported v0.36 x/gov genesis state and migrates it to v0.40 x/gov genesis state. The migration includes:

- Convert vote option & proposal status from byte to enum. - Migrate proposal content to Any. - Convert addresses from bytes to bech32 strings. - Re-encode in v0.40 GenesisState.

func ProposalKey added in v0.43.0

func ProposalKey(proposalID uint64) []byte

ProposalKey gets a specific proposal from the store

func SplitActiveProposalQueueKey added in v0.43.0

func SplitActiveProposalQueueKey(key []byte) (proposalID uint64, endTime time.Time)

SplitActiveProposalQueueKey split the active proposal key and returns the proposal id and endTime

func SplitInactiveProposalQueueKey added in v0.43.0

func SplitInactiveProposalQueueKey(key []byte) (proposalID uint64, endTime time.Time)

SplitInactiveProposalQueueKey split the inactive proposal key and returns the proposal id and endTime

func SplitKeyDeposit added in v0.43.0

func SplitKeyDeposit(key []byte) (proposalID uint64, depositorAddr sdk.AccAddress)

SplitKeyDeposit split the deposits key and returns the proposal id and depositor address

func SplitKeyVote added in v0.43.0

func SplitKeyVote(key []byte) (proposalID uint64, voterAddr sdk.AccAddress)

SplitKeyVote split the votes key and returns the proposal id and voter address

func SplitProposalKey added in v0.43.0

func SplitProposalKey(key []byte) (proposalID uint64)

SplitProposalKey split the proposal key and returns the proposal id

func VoteKey added in v0.43.0

func VoteKey(proposalID uint64, voterAddr sdk.AccAddress) []byte

VoteKey key of a specific vote from the store

func VotesKey added in v0.43.0

func VotesKey(proposalID uint64) []byte

VotesKey gets the first part of the votes key based on the proposalID

Types

This section is empty.

Jump to

Keyboard shortcuts

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