[#2620] Update undelegate message to be more clear

pull/2622/head
Janet Liang 5 years ago
parent 81fae5147c
commit 9b93b9376f
  1. 2
      core/staking_verifier_test.go
  2. 3
      staking/types/validator.go

@ -522,7 +522,7 @@ func TestCV31(t *testing.T) {
if _, err := VerifyAndCreateValidatorFromMsg(
statedb, postStakingEpoch, big.NewInt(0), msg,
); err == nil {
t.Error("expected", "have 4000000000000000000 want 5000000000000000000: self delegation can not be less than min_self_delegation", "got", nil)
t.Error("expected", "min_self_delegation 5000000000000000000, after delegation amount 4000000000000000000: self delegation can not be less than min_self_delegation", "got", nil)
}
}

@ -331,7 +331,8 @@ func (w *ValidatorWrapper) SanityCheck(
w.Delegations[0].Amount.Cmp(w.Validator.MinSelfDelegation) < 0 {
return errors.Wrapf(
errInvalidSelfDelegation,
"have %s want %s", w.Delegations[0].Amount.String(), w.Validator.MinSelfDelegation,
"min_self_delegation %s, after undelegation amount %s",
w.Validator.MinSelfDelegation, w.Delegations[0].Amount.String(),
)
}
}

Loading…
Cancel
Save