-
Notifications
You must be signed in to change notification settings - Fork 103
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
Add RegisterInvariants to Configuration #273
Conversation
Codecov Report
@@ Coverage Diff @@
## master #273 +/- ##
==========================================
- Coverage 62.17% 61.74% -0.43%
==========================================
Files 47 48 +1
Lines 3003 3100 +97
==========================================
+ Hits 1867 1914 +47
- Misses 914 947 +33
- Partials 222 239 +17 |
…ikhita/add-invariants
# Conflicts: # go.mod
# Conflicts: # go.mod
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.
groupTotalWeightInvariant
implementation is wrong
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.
almost there! just a small fix and nit
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 had a look at both invariants, and their tests, it lgtm. Thanks @likhita-809 and @blushi!
One invariant I'm thinking is: the Tally on a proposal should be equal to the sum of all weigthed votes. @blushi Do you think that's useful? (If yes, we can definitely add that in another PR). |
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.
pre-approving, pending small change requests
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.
Thanks @likhita-809!
Closes: #223
An Invariant is a function that checks for a particular invariant within a module. These functions are useful to detect bugs early on and act upon them to limit their potential consequences (e.g. by halting the chain). If the invariant has been broken, it should return an error containing a descriptive message about what happened and a boolean indicating whether the invariant has been broken.