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(gno.land): limit gas in simulate and query #3654

Merged
merged 10 commits into from
Feb 13, 2025
2 changes: 1 addition & 1 deletion gno.land/pkg/gnoland/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ func newGasPriceTestApp(t *testing.T) abci.Application {
}
}

newCtx = auth.SetGasMeter(false, ctx, tx.Fee.GasWanted)
newCtx = auth.SetGasMeter(ctx, tx.Fee.GasWanted)

count := getTotalCount(tx)

Expand Down
1 change: 0 additions & 1 deletion gno.land/pkg/integration/process_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ func TestMain(m *testing.M) {

// Check if the embedded command should be executed
if !*runCommand {
fmt.Println("Running tests...")
os.Exit(m.Run())
}

Expand Down
2 changes: 1 addition & 1 deletion gno.land/pkg/integration/testdata/addpkg_invalid.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
gnoland start

# add bar package located in $WORK directory as gno.land/r/foobar/bar
! gnokey maketx addpkg -pkgdir $WORK -pkgpath gno.land/r/foobar/bar -gas-fee 1000000ugnot -gas-wanted 2000000 -broadcast -chainid=tendermint_test test1
! gnokey maketx addpkg -pkgdir $WORK -pkgpath gno.land/r/foobar/bar -gas-fee 10000000ugnot -gas-wanted 20000000 -broadcast -chainid=tendermint_test test1

# check error message
stdout 'TX HASH: '
Expand Down
8 changes: 3 additions & 5 deletions gno.land/pkg/integration/testdata/addpkg_namespace.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ stdout 'true'

# Try to add a pkg an with unregistered user
# gui addpkg -> gno.land/r/<addr_test1>/one
! gnokey maketx addpkg -pkgdir $WORK -pkgpath gno.land/r/$test1_user_addr/one -gas-fee 1000000ugnot -gas-wanted 1000000 -broadcast -chainid=tendermint_test gui
! gnokey maketx addpkg -pkgdir $WORK -pkgpath gno.land/r/$test1_user_addr/one -gas-fee 1000000ugnot -gas-wanted 10_000_000 -broadcast -chainid=tendermint_test gui
stderr 'unauthorized user'

# Try to add a pkg with an unregistered user, on their own address as namespace
Expand All @@ -55,8 +55,7 @@ stdout 'OK!'

# Call addpkg with admin user on gui namespace
# admin addpkg -> gno.land/r/guiland/one
# This is expected to fail at the transaction simulation stage, which is why we set gas-wanted to 1.
! gnokey maketx addpkg -pkgdir $WORK -pkgpath gno.land/r/guiland/one -gas-fee 1000000ugnot -gas-wanted 1 -broadcast -chainid=tendermint_test admin
! gnokey maketx addpkg -pkgdir $WORK -pkgpath gno.land/r/guiland/one -gas-fee 1000000ugnot -gas-wanted 10_000_000 -broadcast -chainid=tendermint_test admin
stderr 'unauthorized user'

## Test registered namespace
Expand All @@ -78,8 +77,7 @@ stdout 'OK!'

# Test admin publishing on guiland/two
# admin addpkg -> gno.land/r/guiland/two
# This is expected to fail at the transaction simulation stage, which is why we set gas-wanted to 1.
! gnokey maketx addpkg -pkgdir $WORK -pkgpath gno.land/r/guiland/two -gas-fee 1000000ugnot -gas-wanted 1 -broadcast -chainid=tendermint_test admin
! gnokey maketx addpkg -pkgdir $WORK -pkgpath gno.land/r/guiland/two -gas-fee 1000000ugnot -gas-wanted 10_000_000 -broadcast -chainid=tendermint_test admin
stderr 'unauthorized user'

-- one.gno --
Expand Down
38 changes: 19 additions & 19 deletions gno.land/pkg/integration/testdata/assertorigincall.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -35,85 +35,85 @@ gnoland start

# Test cases
## 1. MsgCall -> myrlm.A: PANIC
! gnokey maketx call -pkgpath gno.land/r/myrlm -func A -gas-fee 100000ugnot -gas-wanted 1 -broadcast -chainid tendermint_test test1
! gnokey maketx call -pkgpath gno.land/r/myrlm -func A -gas-fee 100000ugnot -gas-wanted 10_000_000 -broadcast -chainid tendermint_test test1
stderr 'invalid non-origin call'

## 2. MsgCall -> myrlm.B: PASS
gnokey maketx call -pkgpath gno.land/r/myrlm -func B -gas-fee 100000ugnot -gas-wanted 150000 -broadcast -chainid tendermint_test test1
gnokey maketx call -pkgpath gno.land/r/myrlm -func B -gas-fee 100000ugnot -gas-wanted 10_000_000 -broadcast -chainid tendermint_test test1
stdout 'OK!'

## 3. MsgCall -> myrlm.C: PASS
gnokey maketx call -pkgpath gno.land/r/myrlm -func C -gas-fee 100000ugnot -gas-wanted 1500000 -broadcast -chainid tendermint_test test1
gnokey maketx call -pkgpath gno.land/r/myrlm -func C -gas-fee 100000ugnot -gas-wanted 10_000_000 -broadcast -chainid tendermint_test test1
stdout 'OK!'

## 4. MsgCall -> r/foo.A -> myrlm.A: PANIC
! gnokey maketx call -pkgpath gno.land/r/foo -func A -gas-fee 100000ugnot -gas-wanted 1 -broadcast -chainid tendermint_test test1
! gnokey maketx call -pkgpath gno.land/r/foo -func A -gas-fee 100000ugnot -gas-wanted 10_000_000 -broadcast -chainid tendermint_test test1
stderr 'invalid non-origin call'

## 5. MsgCall -> r/foo.B -> myrlm.B: PASS
gnokey maketx call -pkgpath gno.land/r/foo -func B -gas-fee 100000ugnot -gas-wanted 200000 -broadcast -chainid tendermint_test test1
gnokey maketx call -pkgpath gno.land/r/foo -func B -gas-fee 100000ugnot -gas-wanted 10_000_000 -broadcast -chainid tendermint_test test1
stdout 'OK!'

## 6. MsgCall -> r/foo.C -> myrlm.C: PANIC
! gnokey maketx call -pkgpath gno.land/r/foo -func C -gas-fee 100000ugnot -gas-wanted 10000000 -broadcast -chainid tendermint_test test1
! gnokey maketx call -pkgpath gno.land/r/foo -func C -gas-fee 100000ugnot -gas-wanted 10_000_000 -broadcast -chainid tendermint_test test1
stderr 'invalid non-origin call'

## remove due to update to maketx call can only call realm (case 7,8,9)
## 7. MsgCall -> p/demo/bar.A: PANIC
## ! gnokey maketx call -pkgpath gno.land/p/demo/bar -func A -gas-fee 100000ugnot -gas-wanted 5000000 -broadcast -chainid tendermint_test test1
## ! gnokey maketx call -pkgpath gno.land/p/demo/bar -func A -gas-fee 100000ugnot -gas-wanted 10_000_000 -broadcast -chainid tendermint_test test1
## stderr 'invalid non-origin call'

## 8. MsgCall -> p/demo/bar.B: PASS
## gnokey maketx call -pkgpath gno.land/p/demo/bar -func B -gas-fee 100000ugnot -gas-wanted 5000000 -broadcast -chainid tendermint_test test1
## gnokey maketx call -pkgpath gno.land/p/demo/bar -func B -gas-fee 100000ugnot -gas-wanted 10_000_000 -broadcast -chainid tendermint_test test1
## stdout 'OK!'

## 9. MsgCall -> p/demo/bar.C: PANIC
## ! gnokey maketx call -pkgpath gno.land/p/demo/bar -func C -gas-fee 100000ugnot -gas-wanted 5000000 -broadcast -chainid tendermint_test test1
## ! gnokey maketx call -pkgpath gno.land/p/demo/bar -func C -gas-fee 100000ugnot -gas-wanted 10_000_000 -broadcast -chainid tendermint_test test1
## stderr 'invalid non-origin call'

## 10. MsgRun -> run.main -> myrlm.A: PANIC
! gnokey maketx run -gas-fee 100000ugnot -gas-wanted 5500000 -broadcast -chainid tendermint_test test1 $WORK/run/myrlmA.gno
! gnokey maketx run -gas-fee 100000ugnot -gas-wanted 10_000_000 -broadcast -chainid tendermint_test test1 $WORK/run/myrlmA.gno
stderr 'invalid non-origin call'

## 11. MsgRun -> run.main -> myrlm.B: PASS
gnokey maketx run -gas-fee 100000ugnot -gas-wanted 10000000 -broadcast -chainid tendermint_test test1 $WORK/run/myrlmB.gno
gnokey maketx run -gas-fee 100000ugnot -gas-wanted 10_000_000 -broadcast -chainid tendermint_test test1 $WORK/run/myrlmB.gno
stdout 'OK!'

## 12. MsgRun -> run.main -> myrlm.C: PANIC
! gnokey maketx run -gas-fee 100000ugnot -gas-wanted 5500000 -broadcast -chainid tendermint_test test1 $WORK/run/myrlmC.gno
! gnokey maketx run -gas-fee 100000ugnot -gas-wanted 10_000_000 -broadcast -chainid tendermint_test test1 $WORK/run/myrlmC.gno
stderr 'invalid non-origin call'

## 13. MsgRun -> run.main -> foo.A: PANIC
! gnokey maketx run -gas-fee 100000ugnot -gas-wanted 5500000 -broadcast -chainid tendermint_test test1 $WORK/run/fooA.gno
! gnokey maketx run -gas-fee 100000ugnot -gas-wanted 10_000_000 -broadcast -chainid tendermint_test test1 $WORK/run/fooA.gno
stderr 'invalid non-origin call'

## 14. MsgRun -> run.main -> foo.B: PASS
gnokey maketx run -gas-fee 100000ugnot -gas-wanted 10000000 -broadcast -chainid tendermint_test test1 $WORK/run/fooB.gno
gnokey maketx run -gas-fee 100000ugnot -gas-wanted 10_000_000 -broadcast -chainid tendermint_test test1 $WORK/run/fooB.gno
stdout 'OK!'

## 15. MsgRun -> run.main -> foo.C: PANIC
! gnokey maketx run -gas-fee 100000ugnot -gas-wanted 5500000 -broadcast -chainid tendermint_test test1 $WORK/run/fooC.gno
! gnokey maketx run -gas-fee 100000ugnot -gas-wanted 10_000_000 -broadcast -chainid tendermint_test test1 $WORK/run/fooC.gno
stderr 'invalid non-origin call'

## 16. MsgRun -> run.main -> bar.A: PANIC
! gnokey maketx run -gas-fee 100000ugnot -gas-wanted 5500000 -broadcast -chainid tendermint_test test1 $WORK/run/barA.gno
! gnokey maketx run -gas-fee 100000ugnot -gas-wanted 10_000_000 -broadcast -chainid tendermint_test test1 $WORK/run/barA.gno
stderr 'invalid non-origin call'

## 17. MsgRun -> run.main -> bar.B: PASS
gnokey maketx run -gas-fee 100000ugnot -gas-wanted 10000000 -broadcast -chainid tendermint_test test1 $WORK/run/barB.gno
stdout 'OK!'

## 18. MsgRun -> run.main -> bar.C: PANIC
! gnokey maketx run -gas-fee 100000ugnot -gas-wanted 5500000 -broadcast -chainid tendermint_test test1 $WORK/run/barC.gno
! gnokey maketx run -gas-fee 100000ugnot -gas-wanted 10_000_000 -broadcast -chainid tendermint_test test1 $WORK/run/barC.gno
stderr 'invalid non-origin call'

## remove testcase 19 due to maketx call forced to call a realm
## 19. MsgCall -> std.AssertOriginCall: pass
## gnokey maketx call -pkgpath std -func AssertOriginCall -gas-fee 100000ugnot -gas-wanted 10000000 -broadcast -chainid tendermint_test test1
## gnokey maketx call -pkgpath std -func AssertOriginCall -gas-fee 100000ugnot -gas-wanted 10_000_000 -broadcast -chainid tendermint_test test1
## stdout 'OK!'

## 20. MsgRun -> std.AssertOriginCall: PANIC
! gnokey maketx run -gas-fee 100000ugnot -gas-wanted 10000000 -broadcast -chainid tendermint_test test1 $WORK/run/baz.gno
! gnokey maketx run -gas-fee 100000ugnot -gas-wanted 10_000_000 -broadcast -chainid tendermint_test test1 $WORK/run/baz.gno
stderr 'invalid non-origin call'


Expand Down
3 changes: 1 addition & 2 deletions gno.land/pkg/integration/testdata/ghverify.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ gnokey maketx call -pkgpath gno.land/r/gnoland/ghverify -func GetAddressByHandle
stdout ""

# fail on ingestion with a bad task ID
# This is expected to fail at the transaction simulation stage, which is why we set gas-wanted to 1.
! gnokey maketx call -pkgpath gno.land/r/gnoland/ghverify -func GnorkleEntrypoint -args 'ingest,a' -gas-fee 1000000ugnot -gas-wanted 1 -broadcast -chainid=tendermint_test test1
! gnokey maketx call -pkgpath gno.land/r/gnoland/ghverify -func GnorkleEntrypoint -args 'ingest,a' -gas-fee 1000000ugnot -gas-wanted 10_000_000 -broadcast -chainid=tendermint_test test1
stderr 'invalid ingest id: a'

# the agent publishes their response to the task and the verification is complete
Expand Down
4 changes: 4 additions & 0 deletions gno.land/pkg/integration/testdata/gnokey_simulate.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ stdout '"sequence": "5"'
gnokey query vm/qeval --data "gno.land/r/hello.Hello()"
stdout 'Hello, George!'

# simulate should panic if gas-wanted is beyond the max block gas.
! gnokey maketx call -pkgpath gno.land/r/hello -func SetName -args Paul -gas-wanted 100_000_000_000_000 -gas-fee 1000000ugnot -broadcast -chainid tendermint_test -simulate only test1
stderr 'invalid gas wanted'

-- test/test.gno --
package test

Expand Down
4 changes: 2 additions & 2 deletions gno.land/pkg/integration/testdata/grc20_invalid_address.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ gnokey maketx call -pkgpath gno.land/r/demo/foo20 -func Faucet -gas-fee 10000000
stdout 'OK!'

# execute Transfer for invalid address
# This is expected to fail at the transaction simulation stage, which is why we set gas-wanted to 1.
! gnokey maketx call -pkgpath gno.land/r/demo/foo20 -func Transfer -args g1ubwj0apf60hd90txhnh855fkac34rxlsvua0aa -args 1 -gas-fee 1000000ugnot -gas-wanted 1 -broadcast -chainid=tendermint_test test1
# This is expected to fail at the transaction simulation stage.
! gnokey maketx call -pkgpath gno.land/r/demo/foo20 -func Transfer -args g1ubwj0apf60hd90txhnh855fkac34rxlsvua0aa -args 1 -gas-fee 1000000ugnot -gas-wanted 10_000_000 -simulate only -broadcast -chainid=tendermint_test test1
stderr '"gnokey" error: --= Error =--\nData: invalid address'
78 changes: 78 additions & 0 deletions gno.land/pkg/integration/testdata/infinite_loop.txtar
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# regression test for https://github.com/gnolang/gno/issues/3612
# infinite loops should panic in all of simulate, query, render, maketx run and addpkg.

gnoland start

# addpkg + -simulate skip
! gnokey maketx addpkg -pkgdir $WORK/r1 -pkgpath gno.land/r/demo/r1 -simulate skip -gas-fee 10000000ugnot -gas-wanted 10_000_000 -broadcast -chainid=tendermint_test test1
! stdout OK!
stderr 'out of gas.* location: CPUCycles'

# addpkg + -simulate only
! gnokey maketx addpkg -pkgdir $WORK/r1 -pkgpath gno.land/r/demo/r1 -simulate only -gas-fee 10000000ugnot -gas-wanted 10_000_000 -broadcast -chainid=tendermint_test test1
! stdout OK!
stderr 'out of gas.* location: CPUCycles'

# run + -simulate skip
! gnokey maketx run -simulate skip -gas-fee 10000000ugnot -gas-wanted 10_000_000 -broadcast -chainid=tendermint_test test1 $WORK/run.gno
! stdout OK!
stderr 'out of gas.* location: CPUCycles'

# run + -simulate only
! gnokey maketx run -simulate only -gas-fee 10000000ugnot -gas-wanted 10_000_000 -broadcast -chainid=tendermint_test test1 $WORK/run.gno
! stdout OK!
stderr 'out of gas.* location: CPUCycles'

# maketx addpkg on r2 (successful)
gnokey maketx addpkg -pkgdir $WORK/r2 -pkgpath gno.land/r/demo/r2 -gas-fee 10000000ugnot -gas-wanted 10_000_000 -broadcast -chainid=tendermint_test test1
stdout OK!

# qeval on the render function
! gnokey query vm/qeval --data "gno.land/r/demo/r2.Render(\"helloworld\")"
stderr 'out of gas.* location: CPUCycles'

# qrender function
! gnokey query vm/qrender --data 'gno.land/r/demo/r2:noice'
stderr 'out of gas.* location: CPUCycles'

# call on the render function
! gnokey maketx call -pkgpath gno.land/r/demo/r2 -func Render -args '' -simulate skip -gas-fee 100000ugnot -gas-wanted 1000000 -broadcast -chainid tendermint_test test1
stderr 'out of gas.* location: CPUCycles'

# simulated call on the render function
! gnokey maketx call -pkgpath gno.land/r/demo/r2 -func Render -args '' -simulate only -gas-fee 100000ugnot -gas-wanted 1000000 -broadcast -chainid tendermint_test test1
stderr 'out of gas.* location: CPUCycles'

-- run.gno --
package main

func main() {
for {}

println("hey")
}

-- r1/gno.mod --
module gno.land/r/demo/r1


-- r1/realm.gno --
package f1

func init() {
for {}
}

func main() {}

-- r2/gno.mod --
module gno.land/r/demo/r2


-- r2/realm.gno --
package r2

func Render(s string) string {
for {}
return "hello world!"
}
18 changes: 4 additions & 14 deletions gno.land/pkg/sdk/vm/gas_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ func TestAddPkgDeliverTxInsuffGas(t *testing.T) {
ctx, tx, vmHandler := setupAddPkg(isValidTx)

ctx = ctx.WithMode(sdk.RunTxModeDeliver)
simulate := false
tx.Fee.GasWanted = 3000
gctx := auth.SetGasMeter(simulate, ctx, tx.Fee.GasWanted)
gctx := auth.SetGasMeter(ctx, tx.Fee.GasWanted)
// Has to be set up after gas meter in the context; so the stores are
// correctly wrapped in gas stores.
gctx = vmHandler.vm.MakeGnoTransactionStore(gctx)
Expand Down Expand Up @@ -61,12 +60,9 @@ func TestAddPkgDeliverTx(t *testing.T) {
isValidTx := true
ctx, tx, vmHandler := setupAddPkg(isValidTx)

var simulate bool

ctx = ctx.WithMode(sdk.RunTxModeDeliver)
simulate = false
tx.Fee.GasWanted = 500000
gctx := auth.SetGasMeter(simulate, ctx, tx.Fee.GasWanted)
gctx := auth.SetGasMeter(ctx, tx.Fee.GasWanted)
gctx = vmHandler.vm.MakeGnoTransactionStore(gctx)
msgs := tx.GetMsgs()
res := vmHandler.Process(gctx, msgs[0])
Expand All @@ -83,12 +79,9 @@ func TestAddPkgDeliverTxFailed(t *testing.T) {
isValidTx := false
ctx, tx, vmHandler := setupAddPkg(isValidTx)

var simulate bool

ctx = ctx.WithMode(sdk.RunTxModeDeliver)
simulate = false
tx.Fee.GasWanted = 500000
gctx := auth.SetGasMeter(simulate, ctx, tx.Fee.GasWanted)
gctx := auth.SetGasMeter(ctx, tx.Fee.GasWanted)
gctx = vmHandler.vm.MakeGnoTransactionStore(gctx)
msgs := tx.GetMsgs()
res := vmHandler.Process(gctx, msgs[0])
Expand All @@ -103,12 +96,9 @@ func TestAddPkgDeliverTxFailedNoGas(t *testing.T) {
isValidTx := false
ctx, tx, vmHandler := setupAddPkg(isValidTx)

var simulate bool

ctx = ctx.WithMode(sdk.RunTxModeDeliver)
simulate = false
tx.Fee.GasWanted = 1230
gctx := auth.SetGasMeter(simulate, ctx, tx.Fee.GasWanted)
gctx := auth.SetGasMeter(ctx, tx.Fee.GasWanted)
gctx = vmHandler.vm.MakeGnoTransactionStore(gctx)

var res sdk.Result
Expand Down
26 changes: 4 additions & 22 deletions gno.land/pkg/sdk/vm/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,10 @@ func (vh vmHandler) handleMsgRun(ctx sdk.Context, msg MsgRun) (res sdk.Result) {

// query paths
const (
QueryPackage = "package"
QueryStore = "store"
QueryRender = "qrender"
QueryFuncs = "qfuncs"
QueryEval = "qeval"
QueryFile = "qfile"
QueryRender = "qrender"
QueryFuncs = "qfuncs"
QueryEval = "qeval"
QueryFile = "qfile"
)

func (vh vmHandler) Query(ctx sdk.Context, req abci.RequestQuery) abci.ResponseQuery {
Expand All @@ -83,10 +81,6 @@ func (vh vmHandler) Query(ctx sdk.Context, req abci.RequestQuery) abci.ResponseQ
)

switch path {
case QueryPackage:
res = vh.queryPackage(ctx, req)
case QueryStore:
res = vh.queryStore(ctx, req)
case QueryRender:
res = vh.queryRender(ctx, req)
case QueryFuncs:
Expand All @@ -105,18 +99,6 @@ func (vh vmHandler) Query(ctx sdk.Context, req abci.RequestQuery) abci.ResponseQ
return res
}

// queryPackage fetch a package's files.
func (vh vmHandler) queryPackage(ctx sdk.Context, req abci.RequestQuery) (res abci.ResponseQuery) {
res.Data = []byte(fmt.Sprintf("TODO: parse parts get or make fileset..."))
return
}

// queryPackage fetch items from the store.
func (vh vmHandler) queryStore(ctx sdk.Context, req abci.RequestQuery) (res abci.ResponseQuery) {
res.Data = []byte(fmt.Sprintf("TODO: fetch from store"))
return
}

// queryRender calls .Render(<path>) in readonly mode.
func (vh vmHandler) queryRender(ctx sdk.Context, req abci.RequestQuery) (res abci.ResponseQuery) {
reqData := string(req.Data)
Expand Down
5 changes: 5 additions & 0 deletions gno.land/pkg/sdk/vm/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ func TestVmHandlerQuery_Eval(t *testing.T) {
{input: []byte(`gno.land/r/hello.sl`), expectedResultMatch: `(slice[ref(.*)] []int)`}, // XXX: should return the actual value
{input: []byte(`gno.land/r/hello.sl[1]`), expectedResultMatch: `(slice[ref(.*)] []int)`}, // XXX: should return the actual value
{input: []byte(`gno.land/r/hello.println(1234)`), expectedResultMatch: `^$`}, // XXX: compare stdout?
{
input: []byte(`gno.land/r/hello.func() string { return "hello123" + pvString }()`),
expectedResult: `("hello123private string" string)`,
},

// panics
{input: []byte(`gno.land/r/hello`), expectedPanicMatch: `expected <pkgpath>.<expression> syntax in query input data`},
Expand All @@ -95,6 +99,7 @@ func TestVmHandlerQuery_Eval(t *testing.T) {
{input: []byte(`gno.land/r/doesnotexist.Foo`), expectedErrorMatch: `^invalid package path$`},
{input: []byte(`gno.land/r/hello.Panic()`), expectedErrorMatch: `^foo$`},
{input: []byte(`gno.land/r/hello.sl[6]`), expectedErrorMatch: `^slice index out of bounds: 6 \(len=5\)$`},
{input: []byte(`gno.land/r/hello.func(){ for {} }()`), expectedErrorMatch: `out of gas in location: CPUCycles`},
}

for _, tc := range tt {
Expand Down
Loading
Loading