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
- Variables
- func ActiveProposalByTimeKey(endTime time.Time) []byte
- func ActiveProposalQueueKey(proposalID uint64, endTime time.Time) []byte
- func DepositKey(proposalID uint64, depositorAddr sdk.AccAddress) []byte
- func DepositsKey(proposalID uint64) []byte
- func GetProposalIDBytes(proposalID uint64) (proposalIDBz []byte)
- func GetProposalIDFromBytes(bz []byte) (proposalID uint64)
- func InactiveProposalByTimeKey(endTime time.Time) []byte
- func InactiveProposalQueueKey(proposalID uint64, endTime time.Time) []byte
- func Migrate(oldGovState v036gov.GenesisState) *v040gov.GenesisState
- func ProposalKey(proposalID uint64) []byte
- func SplitActiveProposalQueueKey(key []byte) (proposalID uint64, endTime time.Time)
- func SplitInactiveProposalQueueKey(key []byte) (proposalID uint64, endTime time.Time)
- func SplitKeyDeposit(key []byte) (proposalID uint64, depositorAddr sdk.AccAddress)
- func SplitKeyVote(key []byte) (proposalID uint64, voterAddr sdk.AccAddress)
- func SplitProposalKey(key []byte) (proposalID uint64)
- func VoteKey(proposalID uint64, voterAddr sdk.AccAddress) []byte
- func VotesKey(proposalID uint64) []byte
Constants ¶
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 ¶
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
ActiveProposalByTimeKey gets the active proposal queue key by endTime
func ActiveProposalQueueKey ¶ added in v0.43.0
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
DepositsKey gets the first part of the deposits key based on the proposalID
func GetProposalIDBytes ¶ added in v0.43.0
GetProposalIDBytes returns the byte representation of the proposalID
func GetProposalIDFromBytes ¶ added in v0.43.0
GetProposalIDFromBytes returns proposalID in uint64 format from a byte array
func InactiveProposalByTimeKey ¶ added in v0.43.0
InactiveProposalByTimeKey gets the inactive proposal queue key by endTime
func InactiveProposalQueueKey ¶ added in v0.43.0
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
ProposalKey gets a specific proposal from the store
func SplitActiveProposalQueueKey ¶ added in v0.43.0
SplitActiveProposalQueueKey split the active proposal key and returns the proposal id and endTime
func SplitInactiveProposalQueueKey ¶ added in v0.43.0
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
SplitProposalKey split the proposal key and returns the proposal id
Types ¶
This section is empty.