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
This commit is contained in:
gotjoshua 2021-07-06 18:03:59 +01:00 committed by GitHub
parent 0dbc5de9dd
commit bfa18c79be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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: