Merge PR #3546: Min Self Delegation

This commit is contained in:
Sunny Aggarwal
2019-02-08 12:44:19 -08:00
committed by Jack Zampolin
parent ba63eb1801
commit cff985ffc5
31 changed files with 337 additions and 125 deletions
+4
View File
@@ -31,6 +31,10 @@ func handleMsgUnjail(ctx sdk.Context, msg MsgUnjail, k Keeper) sdk.Result {
return ErrMissingSelfDelegation(k.codespace).Result()
}
if validator.GetDelegatorShareExRate().Mul(selfDel.GetShares()).TruncateInt().LT(validator.GetMinSelfDelegation()) {
return ErrSelfDelegationTooLowToUnjail(k.codespace).Result()
}
// cannot be unjailed if not jailed
if !validator.GetJailed() {
return ErrValidatorNotJailed(k.codespace).Result()