-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #13576 +/- ##
==========================================
- Coverage 54.89% 54.79% -0.10%
==========================================
Files 655 655
Lines 56239 56182 -57
==========================================
- Hits 30870 30786 -84
- Misses 22845 22871 +26
- Partials 2524 2525 +1
|
x/gov/keeper/grpc_query.go
Outdated
@@ -87,6 +87,12 @@ func (q Keeper) Proposals(c context.Context, req *v1.QueryProposalsRequest) (*v1 | |||
return nil, status.Error(codes.Internal, err.Error()) | |||
} | |||
|
|||
// Populate contents given that we are iterating the store keys and not using |
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.
I wonder. If this is used by a CW contract. Maybe we extend the request type to include a field include_content
? This way a client can indicate if they want content or not to save gas costs.
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.
LGTM
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.
lgtm, pending spec update (which is not blocking)
ActiveProposalQueuePrefix = []byte{0x01} | ||
InactiveProposalQueuePrefix = []byte{0x02} | ||
ProposalIDKey = []byte{0x03} | ||
VotingPeriodProposalKeyPrefix = []byte{0x04} |
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.
Description
Now we keep track of proposals that are in voting period in a separate store. This way we only have to read a single byte to know if a vote can get accepted.
Thanks @AmauryM for coming up with a better way to do it :)
Closes: #12688
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change