-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
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
feat!: (x/gov) store an index of proposals that are in voting period #13576
Merged
Merged
Changes from 42 commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
63c6057
(x/gov) feat: move parts of Proposal into separate storages
facundomedica d8219fc
fix some
facundomedica cb12f0e
fix others
facundomedica 5514486
fix unit tests
facundomedica 1d62ba4
fix unit tests
facundomedica 4b97f7b
fix conflicts
facundomedica d9364d4
fix conflicts
facundomedica 8e838f5
progress
facundomedica 3fccb66
do not overwrite messages
facundomedica e2bef95
remove change
facundomedica 82998ef
simplify methods
facundomedica da271d5
static data
facundomedica 601c411
fix tests
facundomedica 162353c
fix tests
facundomedica 04e9308
fix tests
facundomedica d62d0c1
rollback some changes
facundomedica 733f286
rollback some changes
facundomedica d7918b7
progress
facundomedica d9d339f
progress
facundomedica 1f32225
progress
facundomedica b5b2ada
progress
facundomedica 37af9c4
progress
facundomedica 1a9a443
progress
facundomedica 2edde57
add delete
facundomedica f4a128f
fix tests
facundomedica 3f8936e
use SetProposalWithoutContents whenever possible
facundomedica 46b087c
add migrations
facundomedica 59dc8a7
fix godoc
facundomedica d7c8cd1
gofumpt
facundomedica 78dbf6c
Merge branch 'main' into facu/gov-storage
facundomedica ece934d
add changelog
facundomedica c3af4cf
rolling back changes
facundomedica 59434a7
rolling back changes
facundomedica 2d07421
progress
facundomedica 4ecb17c
progress
facundomedica c20b48f
progress
facundomedica dd38f3d
progress
facundomedica b6e24af
fix tests
facundomedica ecc8917
fix cl
facundomedica fc8b9d0
fix cl
facundomedica cd2ae66
fix
facundomedica ff62538
fix test error
facundomedica e23a08b
Merge branch 'main' into facu/gov-storage
facundomedica e42c114
add store key in readme
facundomedica 97e54bd
add store key in readme
facundomedica 0bda41c
Merge branch 'main' into facu/gov-storage
facundomedica 8707966
Merge branch 'facu/gov-storage' of https://github.com/cosmos/cosmos-s…
facundomedica aa1ed8b
Merge branch 'main' into facu/gov-storage
facundomedica File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you update the spec/README.md file too? Just add some info about this new state
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doing it now, ty! As a note I think the store section is not entirely accurate (or at least not very easy to understand), but I'll that there and re-visit later.