-
Notifications
You must be signed in to change notification settings - Fork 16
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): burn deposit if no votes > BurnDepositNoThreshold
#90
base: giunatale/gov/dynamic-deposit
Are you sure you want to change the base?
feat(x/gov): burn deposit if no votes > BurnDepositNoThreshold
#90
Conversation
wwith 0.7 as default value
update default value to 0.8
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.
Just one change I would suggest doing, but aside from that it looks good
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.
let's hold off from merging for now, but LGTM
actually, looking at this again I think we made the same mistake in |
Good catch, I converted all to |
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.
TY!
@@ -419,5 +423,16 @@ func (p Params) ValidateBasic() error { | |||
return fmt.Errorf("minimum initial deposit decrease ratio too large: %s", minInitialDepositDecreaseRatio) | |||
} | |||
|
|||
burnDepositNoThreshold, err := sdk.NewDecFromStr(p.BurnDepositNoThreshold) |
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.
We need to add a check for threshold, law and amendment threshold
so that the burnDepositNoThreshold > 1 - threshold
(or the burn would happen with less than no votes to make a proposal fail, which makes no sense since the proposal would mean is passing)
the same check goes for law and amendment thresholds
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.
If the proposal is passing, the burnDepositNoThreshold
is not checked, so the burn would not happen anyway. But I will still do this burnDepositNoThreshold > 1 - threshold
check so the condition is not tied to the order of code execution.
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.
done here 3788dbb
x/gov/types/v1/params.go
Outdated
if err != nil { | ||
return fmt.Errorf("invalid burnDepositNoThreshold string: %w", err) | ||
} | ||
if !burnDepositNoThreshold.IsPositive() { |
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 would replace this check with the burnDepositNoThreshold > 1 - threshold
&& burnDepositNoThreshold > 1 - lawThreshold
&& && burnDepositNoThreshold > 1 - amendmentThreshold
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.
see 3788dbb
Co-authored-by: Giuseppe Natale <[email protected]>
BurnDepositNoThreshold
has a default value of0.8
.