-
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
Rename revoke(d) to jail(ed) #2120
Conversation
@@ -44,7 +44,7 @@ func (v Validator) GetDelegatorShares() sdk.Dec { | |||
} | |||
|
|||
// Implements sdk.Validator | |||
func (v Validator) GetRevoked() bool { | |||
func (v Validator) GetJailed() bool { |
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'd change it to IsJailed()
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.
the pattern is GetXYZ()
with all the other functions
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 don't disagree with this particular one but it's probably better not to be inconsistent with the rest
@@ -37,7 +37,7 @@ func (b BondStatus) Equal(b2 BondStatus) bool { | |||
|
|||
// validator for a delegated proof of stake system | |||
type Validator interface { | |||
GetRevoked() bool // whether the validator is revoked | |||
GetJailed() bool // whether the validator is jailed |
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.
IsJailed()
|
||
// Validator must exist | ||
validator := k.validatorSet.Validator(ctx, msg.ValidatorAddr) | ||
if validator == nil { | ||
return ErrNoValidatorForAddress(k.codespace).Result() | ||
} | ||
|
||
if !validator.GetRevoked() { | ||
return ErrValidatorNotRevoked(k.codespace).Result() | ||
if !validator.GetJailed() { |
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.
IsJailed()
@@ -113,16 +113,16 @@ func (k Keeper) handleValidatorSignature(ctx sdk.Context, addr crypto.Address, p | |||
minHeight := signInfo.StartHeight + k.SignedBlocksWindow(ctx) | |||
if height > minHeight && signInfo.SignedBlocksCounter < k.MinSignedPerWindow(ctx) { | |||
validator := k.validatorSet.ValidatorByPubKey(ctx, pubkey) | |||
if validator != nil && !validator.GetRevoked() { | |||
// Downtime confirmed, slash, revoke, and jail the validator | |||
if validator != nil && !validator.GetJailed() { |
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.
IsJailed()
// unrevoke to measure power | ||
sk.Unrevoke(ctx, val) | ||
// should be jailed | ||
require.True(t, sk.Validator(ctx, addr).GetJailed()) |
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.
same
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
Closes #1305
docs/
)PENDING.md
with issue #Files changed
in the github PR explorerFor Admin Use: