-
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
Weighted votes migrate in-place migrations #8663
Conversation
8ab73c9
to
8670f49
Compare
x/gov/legacy/v040/types.go
Outdated
// Package v040 is take from: | ||
// https://github.com/cosmos/cosmos-sdk/blob/v0.41.1/x/gov/types/vote.go | ||
// by copy-pasted only the relevants parts for Vote. |
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.
In v040 we had
type Vote struct {
ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty" yaml:"proposal_id"`
Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"`
Option types.VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=cosmos.gov.v1beta1.VoteOption" json:"option,omitempty"`
}
and in v042 we add a new field, and marked the 3rd field as reserved, which gives
type Vote struct {
ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty" yaml:"proposal_id"`
Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"`
Options []WeightedVoteOption `protobuf:"bytes,4,rep,name=options,proto3" json:"options"`
}
Here, I went through the old .pb.go and copy-pasted the minimum to have the old vote struct and its proto marshaling working.
This pull request introduces 1 alert when merging c5f4d03 into 0e24bad - view on LGTM.com new alerts:
|
c5f4d03
to
922f1ce
Compare
Codecov Report
@@ Coverage Diff @@
## master #8663 +/- ##
==========================================
- Coverage 61.44% 61.41% -0.04%
==========================================
Files 673 674 +1
Lines 38361 38399 +38
==========================================
+ Hits 23571 23581 +10
- Misses 12309 12335 +26
- Partials 2481 2483 +2
|
922f1ce
to
c4eee47
Compare
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
Description
ref: #8345 (comment)
closes #8345
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerCodecov Report
in the comment section below once CI passes