-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: (x/gov) store an index of proposals that are in voting period (#…
…13576) * (x/gov) feat: move parts of Proposal into separate storages * fix some * fix others * fix unit tests * fix unit tests * fix conflicts * progress * do not overwrite messages * remove change * simplify methods * static data * fix tests * fix tests * fix tests * rollback some changes * rollback some changes * progress * progress * progress * progress * progress * progress * add delete * fix tests * use SetProposalWithoutContents whenever possible * add migrations * fix godoc * gofumpt * add changelog * rolling back changes * rolling back changes * progress * progress * progress * progress * fix tests * fix cl * fix cl * fix * fix test error * add store key in readme * add store key in readme
- Loading branch information
1 parent
c833190
commit 91ca57b
Showing
10 changed files
with
142 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,28 @@ | ||
package v4 | ||
|
||
import "encoding/binary" | ||
|
||
const ( | ||
// ModuleName is the name of the module | ||
ModuleName = "gov" | ||
) | ||
|
||
// ParamsKey is the key of x/gov params | ||
var ParamsKey = []byte{0x30} | ||
var ( | ||
// ParamsKey is the key of x/gov params | ||
ParamsKey = []byte{0x30} | ||
|
||
// - 0x04<proposalID_Bytes>: ProposalContents | ||
VotingPeriodProposalKeyPrefix = []byte{0x04} | ||
) | ||
|
||
// VotingPeriodProposalKey gets if a proposal is in voting period. | ||
func VotingPeriodProposalKey(proposalID uint64) []byte { | ||
return append(VotingPeriodProposalKeyPrefix, GetProposalIDBytes(proposalID)...) | ||
} | ||
|
||
// GetProposalIDBytes returns the byte representation of the proposalID | ||
func GetProposalIDBytes(proposalID uint64) (proposalIDBz []byte) { | ||
proposalIDBz = make([]byte, 8) | ||
binary.BigEndian.PutUint64(proposalIDBz, proposalID) | ||
return | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters