fix error's raw log messages ugly encoding

Closes: #5785
This commit is contained in:
Alessio Treglia 2020-03-12 01:29:38 +01:00
parent 43d7d5dc09
commit f8897308d6
No known key found for this signature in database
GPG Key ID: E8A48AE5311D765A
2 changed files with 5 additions and 2 deletions

View File

@ -44,6 +44,9 @@ balances or a single balance by denom when the `denom` query parameter is presen
* (client) [\#5640](https://github.com/cosmos/cosmos-sdk/pull/5640) The rest server endpoint `/swagger-ui/` is replaced by ´/´. * (client) [\#5640](https://github.com/cosmos/cosmos-sdk/pull/5640) The rest server endpoint `/swagger-ui/` is replaced by ´/´.
* (x/auth) [\#5702](https://github.com/cosmos/cosmos-sdk/pull/5702) The `x/auth` querier route has changed from `"acc"` to `"auth"`. * (x/auth) [\#5702](https://github.com/cosmos/cosmos-sdk/pull/5702) The `x/auth` querier route has changed from `"acc"` to `"auth"`.
* (store/types) [\#5730](https://github.com/cosmos/cosmos-sdk/pull/5730) store.types.Cp() is removed in favour of types.CopyBytes(). * (store/types) [\#5730](https://github.com/cosmos/cosmos-sdk/pull/5730) store.types.Cp() is removed in favour of types.CopyBytes().
* [\#5785](https://github.com/cosmos/cosmos-sdk/issues/5785) JSON strings coerced to valid UTF-8 bytes at JSON marshalling time
are now replaced by human-readable expressions. This change can potentially break compatibility with all those client side tools
that parse log messages.
### API Breaking Changes ### API Breaking Changes

View File

@ -67,7 +67,7 @@ func (k BaseKeeper) DelegateCoins(ctx sdk.Context, delegatorAddr, moduleAccAddr
balance := k.GetBalance(ctx, delegatorAddr, coin.Denom) balance := k.GetBalance(ctx, delegatorAddr, coin.Denom)
if balance.IsLT(coin) { if balance.IsLT(coin) {
return sdkerrors.Wrapf( return sdkerrors.Wrapf(
sdkerrors.ErrInsufficientFunds, "failed to delegate; %s < %s", balance, amt, sdkerrors.ErrInsufficientFunds, "failed to delegate; %s is smaller than %s", balance, amt,
) )
} }
@ -265,7 +265,7 @@ func (k BaseSendKeeper) SubtractCoins(ctx sdk.Context, addr sdk.AccAddress, amt
_, hasNeg := sdk.Coins{spendable}.SafeSub(sdk.Coins{coin}) _, hasNeg := sdk.Coins{spendable}.SafeSub(sdk.Coins{coin})
if hasNeg { if hasNeg {
return nil, sdkerrors.Wrapf(sdkerrors.ErrInsufficientFunds, "%s < %s", spendable, coin) return nil, sdkerrors.Wrapf(sdkerrors.ErrInsufficientFunds, "%s is smaller than %s", spendable, coin)
} }
newBalance := balance.Sub(coin) newBalance := balance.Sub(coin)