From 9b93b9376f2a14e72d8a5ccd197cbf63f15bf4c2 Mon Sep 17 00:00:00 2001 From: Janet Liang Date: Fri, 27 Mar 2020 16:05:52 -0700 Subject: [PATCH] [#2620] Update undelegate message to be more clear --- core/staking_verifier_test.go | 2 +- staking/types/validator.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/core/staking_verifier_test.go b/core/staking_verifier_test.go index 23faf16d0..5600265f9 100644 --- a/core/staking_verifier_test.go +++ b/core/staking_verifier_test.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) } } diff --git a/staking/types/validator.go b/staking/types/validator.go index 1106db4ec..38d230e72 100644 --- a/staking/types/validator.go +++ b/staking/types/validator.go @@ -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(), ) } }