-
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
R4R: tallyResults added to state #1914
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #1914 +/- ##
===========================================
+ Coverage 63.55% 63.67% +0.12%
===========================================
Files 119 119
Lines 7062 7083 +21
===========================================
+ Hits 4488 4510 +22
Misses 2314 2314
+ Partials 260 259 -1 |
8f2dcb2
to
d19b2df
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.
Mostly looks good; a few possible typos and one testcase request.
x/gov/proposals.go
Outdated
// checks if two proposals are equal | ||
func TallyResultEqual(resultA TallyResult, resultB TallyResult) bool { | ||
if resultA.Yes.Equal(resultB.Yes) && | ||
resultA.Abstain.Equal(resultB.Yes) && |
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.
resultA.Abstain.Equal(resultB.Abstain)
?
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.
😱
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.
Addressed
x/gov/proposals.go
Outdated
if resultA.Yes.Equal(resultB.Yes) && | ||
resultA.Abstain.Equal(resultB.Yes) && | ||
resultA.No.Equal(resultB.No) && | ||
resultA.NoWithVeto.Equal(resultB.Yes) { |
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.
resultA.NoWithVeto.Equal(resultB.NoWithVeto)
?
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.
Addressed
x/gov/endblocker_test.go
Outdated
@@ -166,6 +167,7 @@ func TestTickPassedVotingPeriod(t *testing.T) { | |||
require.False(t, depositsIterator.Valid()) | |||
depositsIterator.Close() | |||
require.Equal(t, StatusRejected, keeper.GetProposal(ctx, proposalID).GetStatus()) | |||
require.True(t, TallyResultEqual(keeper.GetProposal(ctx, proposalID).GetTallyResult(), EmptyTallyResult())) |
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 we add a quick testcase for a non-empty tally result?
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.
Added in following test, TestSlashing
Also, can we make sure the |
@cwgoes At the moment, the |
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.
utACK
docs/
)PENDING.md
that include links to the relevant issue or PR that most accurately describes the change.cmd/gaia
andexamples/
For Admin Use: