Skip to content

Commit

Permalink
refactor: improve human readable gas error (#9626)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
gotjoshua committed Jul 6, 2021
1 parent 0dbc5de commit bfa18c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions x/auth/ante/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit bfa18c7

Please sign in to comment.