We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently x/gov uses strings instead of bytes for storing the keys on the store. This makes it harder to parse/split and adds extra bytes to the keys:
x/gov
func KeyProposal(proposalID uint64) []byte { return []byte(fmt.Sprintf("proposals:%d", proposalID)) } func KeyDeposit(proposalID uint64, depositorAddr sdk.AccAddress) []byte { return []byte(fmt.Sprintf("deposits:%d:%d", proposalID, depositorAddr)) } func KeyVote(proposalID uint64, voterAddr sdk.AccAddress) []byte { return []byte(fmt.Sprintf("votes:%d:%d", proposalID, voterAddr)) }
Suggested changes:
var ( ProposalKeyPrefix = []byte{0x0} DepositsKeyPrefix = []byte{0x1} VotesKeyPrefix = []byte{0x2} )
keyProposal: 0x0<proposalID_bytes> keyDeposit:0x1<proposalID_bytes><depositorAddress_Bytes> keyVotes: 0x2<proposalID_bytes><voterAddress_Bytes>
0x0<proposalID_bytes>
0x1<proposalID_bytes><depositorAddress_Bytes>
0x2<proposalID_bytes><voterAddress_Bytes>
The text was updated successfully, but these errors were encountered:
fedekunze
Successfully merging a pull request may close this issue.
Summary of Bug
Currently
x/gov
uses strings instead of bytes for storing the keys on the store. This makes it harder to parse/split and adds extra bytes to the keys:Suggested changes:
keyProposal:
0x0<proposalID_bytes>
keyDeposit:
0x1<proposalID_bytes><depositorAddress_Bytes>
keyVotes:
0x2<proposalID_bytes><voterAddress_Bytes>
For Admin Use
The text was updated successfully, but these errors were encountered: