Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(gnovm): show "out of gas" errors (#2365) #2368

Closed
wants to merge 6 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions gnovm/pkg/gnolang/preprocess.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"sync/atomic"

"github.com/gnolang/gno/tm2/pkg/errors"
"github.com/gnolang/gno/tm2/pkg/store/types"
)

const (
Expand Down Expand Up @@ -2855,6 +2856,10 @@
if rerr, ok := r.(error); ok {
// NOTE: gotuna/gorilla expects error exceptions.
panic(errors.Wrap(rerr, loc.String()))
} else if ex, ok := r.(types.OutOfGasException); ok {
// NOTE: baseapp.runTx() handles OutOfGasException
// which it then converts into ABCIError(std.ErrOutOfGas)
panic(ex)

Check warning on line 2862 in gnovm/pkg/gnolang/preprocess.go

View check run for this annotation

Codecov / codecov/patch

gnovm/pkg/gnolang/preprocess.go#L2862

Added line #L2862 was not covered by tests
} else {
// NOTE: gotuna/gorilla expects error exceptions.
panic(fmt.Errorf("%s: %v", loc.String(), r))
Expand Down
Loading