From bfa18c79be1f0ef6f7f28d91f365ca692b624df9 Mon Sep 17 00:00:00 2001 From: gotjoshua Date: Tue, 6 Jul 2021 18:03:59 +0100 Subject: [PATCH] refactor: improve human readable gas error (#9626) as this error ends up being passed on to cli clients and even all the way to web guis, it could be a bit more intuitive. i didn't do anything from the template... but i only changed a single string... take it or leave it. From Osmosis DEX: ![Screen Shot 2021-07-03 at 10 06 46](https://user-images.githubusercontent.com/8686454/124359830-901ecf80-dc1e-11eb-94c4-5fec462afe19.png) https://discord.com/channels/798583171548840026/842518477142884392/860815895789305877 --- x/auth/ante/setup.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/auth/ante/setup.go b/x/auth/ante/setup.go index 6d6d4344c..737cc295b 100644 --- a/x/auth/ante/setup.go +++ b/x/auth/ante/setup.go @@ -51,8 +51,8 @@ func (sud SetUpContextDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate switch rType := r.(type) { case sdk.ErrorOutOfGas: log := fmt.Sprintf( - "out of gas in location: %v; gasWanted: %d, gasUsed: %d", - rType.Descriptor, gasTx.GetGas(), newCtx.GasMeter().GasConsumed()) + "insufficient gas, gasOffered: %d, gasRequired: %d, code location: %v", + gasTx.GetGas(), newCtx.GasMeter().GasConsumed(), rType.Descriptor) err = sdkerrors.Wrap(sdkerrors.ErrOutOfGas, log) default: