Skip to content

Commit

Permalink
Merge pull request #128 from binance-chain/revert-126-feature/fix_err…
Browse files Browse the repository at this point in the history
…or_msg

Revert "[R4R] fix insufficient coins error msg"
  • Loading branch information
yutianwu authored Apr 24, 2019
2 parents d8721e5 + 07ec890 commit 5cd8be3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions x/bank/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ func subtractCoins(ctx sdk.Context, am auth.AccountKeeper, addr sdk.AccAddress,
oldCoins := getCoins(ctx, am, addr)
newCoins := oldCoins.Minus(amt)
if !newCoins.IsNotNegative() {
return amt, nil, sdk.ErrInsufficientCoins(fmt.Sprintf("%s are less than %s", oldCoins, amt))
return amt, nil, sdk.ErrInsufficientCoins(fmt.Sprintf("%s < %s", oldCoins, amt))
}
err := setCoins(ctx, am, addr, newCoins)
tags := sdk.NewTags("sender", []byte(addr.String()))
Expand All @@ -199,7 +199,7 @@ func addCoins(ctx sdk.Context, am auth.AccountKeeper, addr sdk.AccAddress, amt s
oldCoins := getCoins(ctx, am, addr)
newCoins := oldCoins.Plus(amt)
if !newCoins.IsNotNegative() {
return amt, nil, sdk.ErrInsufficientCoins(fmt.Sprintf("%s are less than %s", oldCoins, amt))
return amt, nil, sdk.ErrInsufficientCoins(fmt.Sprintf("%s < %s", oldCoins, amt))
}
err := setCoins(ctx, am, addr, newCoins)
tags := sdk.NewTags("recipient", []byte(addr.String()))
Expand Down

0 comments on commit 5cd8be3

Please sign in to comment.