From 96d660593a832b65f3b8e5a1d04848077cfb0859 Mon Sep 17 00:00:00 2001 From: rigelrozanski Date: Tue, 10 Jul 2018 00:07:01 -0400 Subject: [PATCH 1/2] fix cli delegations unmarshalling --- x/stake/client/cli/tx.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/x/stake/client/cli/tx.go b/x/stake/client/cli/tx.go index 4701e4c20..d5c974cad 100644 --- a/x/stake/client/cli/tx.go +++ b/x/stake/client/cli/tx.go @@ -240,15 +240,10 @@ func getShares(storeName string, cdc *wire.Codec, sharesAmountStr, sharesPercent key := stake.GetDelegationKey(delegatorAddr, validatorAddr) ctx := context.NewCoreContextFromViper() resQuery, err := ctx.QueryStore(key, storeName) - if err != nil { - return sharesAmount, err - } - var delegation stake.Delegation - err = cdc.UnmarshalBinary(resQuery, &delegation) if err != nil { return sharesAmount, errors.Errorf("cannot find delegation to determine percent Error: %v", err) } - + delegation := types.MustUnmarshalDelegation(cdc, key, resQuery) sharesAmount = sharesPercent.Mul(delegation.Shares) } return From ce3fd47f9d4971acd8046f25f9677e501cbf0c74 Mon Sep 17 00:00:00 2001 From: rigelrozanski Date: Tue, 10 Jul 2018 00:12:50 -0400 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48ddab70f..088a4dbd1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -124,6 +124,7 @@ BUG FIXES * [x/stake] fix revoke bytes ordering (was putting revoked candidates at the top of the list) * [x/stake] bond count was counting revoked validators as bonded, fixed * \#1565 - fix cliff validator persisting when validator set shrinks from max +* [x/stake] fix bug when unbonding/redelegating using `--shares-percent` ## 0.19.0