v040

package
v1.0.1-0...-86249ee Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2023 License: Apache-2.0 Imports: 16 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

func ActiveProposalByTimeKey(endTime time.Time) []byte

ActiveProposalByTimeKey gets the active proposal queue key by endTime

func ActiveProposalQueueKey

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

ActiveProposalQueueKey returns the key for a proposalID in the activeProposalQueue

func DepositKey

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

DepositKey key of a specific deposit from the store

func DepositsKey

func DepositsKey(proposalID uint64) []byte

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

func GetProposalIDBytes

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

GetProposalIDBytes returns the byte representation of the proposalID

func GetProposalIDFromBytes

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

GetProposalIDFromBytes returns proposalID in uint64 format from a byte array

func InactiveProposalByTimeKey

func InactiveProposalByTimeKey(endTime time.Time) []byte

InactiveProposalByTimeKey gets the inactive proposal queue key by endTime

func InactiveProposalQueueKey

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

func ProposalKey(proposalID uint64) []byte

ProposalKey gets a specific proposal from the store

func SplitActiveProposalQueueKey

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

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

func SplitInactiveProposalQueueKey

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

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

func SplitKeyDeposit

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

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

func SplitKeyVote

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

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

func SplitProposalKey

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

SplitProposalKey split the proposal key and returns the proposal id

func VoteKey

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

VoteKey key of a specific vote from the store

func VotesKey

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