Merge PR #1614: fix cli delegations unmarshalling
This commit is contained in:
commit
06be53a983
|
@ -129,8 +129,10 @@ BUG FIXES
|
|||
* \#1461 - CLI tests now no longer reset your local environment data
|
||||
* \#1505 - `gaiacli stake validator` no longer panics if validator doesn't exist
|
||||
* \#1565 - fix cliff validator persisting when validator set shrinks from max
|
||||
* [x/stake] fix bug when unbonding/redelegating using `--shares-percent`
|
||||
* \#1010 - two validators can't bond with the same pubkey anymore
|
||||
|
||||
|
||||
## 0.19.0
|
||||
|
||||
*June 13, 2018*
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue