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 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 ¶
ActiveProposalByTimeKey gets the active proposal queue key by endTime
func ActiveProposalQueueKey ¶
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 ¶
DepositsKey gets the first part of the deposits key based on the proposalID
func GetProposalIDBytes ¶
GetProposalIDBytes returns the byte representation of the proposalID
func GetProposalIDFromBytes ¶
GetProposalIDFromBytes returns proposalID in uint64 format from a byte array
func InactiveProposalByTimeKey ¶
InactiveProposalByTimeKey gets the inactive proposal queue key by endTime
func InactiveProposalQueueKey ¶
InactiveProposalQueueKey returns the key for a proposalID in the inactiveProposalQueue
func ProposalKey ¶
ProposalKey gets a specific proposal from the store
func SplitActiveProposalQueueKey ¶
SplitActiveProposalQueueKey split the active proposal key and returns the proposal id and endTime
func SplitInactiveProposalQueueKey ¶
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 ¶
SplitProposalKey split the proposal key and returns the proposal id
Types ¶
This section is empty.