Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
petar-dambovaliev committed Feb 4, 2025
1 parent d58229c commit fd946d4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions gno.land/pkg/integration/testdata/restart.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
loadpkg gno.land/r/demo/counter $WORK
gnoland start

gnokey maketx call -pkgpath gno.land/r/demo/counter -func Incr -gas-fee 1000000ugnot -gas-wanted 220000 -broadcast -chainid tendermint_test test1
gnokey maketx call -pkgpath gno.land/r/demo/counter -func Incr -gas-fee 2000000ugnot -gas-wanted 350000 -broadcast -chainid tendermint_test test1
stdout '\(1 int\)'

gnoland restart

gnokey maketx call -pkgpath gno.land/r/demo/counter -func Incr -gas-fee 1000000ugnot -gas-wanted 220000 -broadcast -chainid tendermint_test test1
gnokey maketx call -pkgpath gno.land/r/demo/counter -func Incr -gas-fee 2000000ugnot -gas-wanted 350000 -broadcast -chainid tendermint_test test1
stdout '\(2 int\)'

-- counter.gno --
Expand Down
4 changes: 2 additions & 2 deletions gno.land/pkg/integration/testdata/simulate_gas.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ loadpkg gno.land/r/simulate $WORK/simulate
gnoland start

# simulate only
gnokey maketx call -pkgpath gno.land/r/simulate -func Hello -gas-fee 1000000ugnot -gas-wanted 2200000 -broadcast -chainid=tendermint_test -simulate only test1
gnokey maketx call -pkgpath gno.land/r/simulate -func Hello -gas-fee 2000000ugnot -gas-wanted 2200000 -broadcast -chainid=tendermint_test -simulate only test1
stdout 'GAS USED: 99371'

# simulate skip
gnokey maketx call -pkgpath gno.land/r/simulate -func Hello -gas-fee 1000000ugnot -gas-wanted 2200000 -broadcast -chainid=tendermint_test -simulate skip test1
gnokey maketx call -pkgpath gno.land/r/simulate -func Hello -gas-fee 2000000ugnot -gas-wanted 2200000 -broadcast -chainid=tendermint_test -simulate skip test1
stdout 'GAS USED: 99371' # same as simulate only


Expand Down
7 changes: 7 additions & 0 deletions gnovm/pkg/gnolang/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@ func (m *Machine) PreprocessAllFilesAndSaveBlockNodes() {
}

pv := pn.NewPackage()
store.SetObject(pv)
store.SetCachePackage(pv)
store.SetBlockNode(pn)

return pn, pv

Check warning on line 272 in gnovm/pkg/gnolang/machine.go

View check run for this annotation

Codecov / codecov/patch

gnovm/pkg/gnolang/machine.go#L267-L272

Added lines #L267 - L272 were not covered by tests
}

Expand All @@ -274,6 +278,9 @@ func (m *Machine) PreprocessAllFilesAndSaveBlockNodes() {
// Register unprocessed packages in store
ch := m.Store.IterMemPackage()
for memPkg := range ch {
if memPkg == nil {
continue

Check warning on line 282 in gnovm/pkg/gnolang/machine.go

View check run for this annotation

Codecov / codecov/patch

gnovm/pkg/gnolang/machine.go#L276-L282

Added lines #L276 - L282 were not covered by tests
}
// Just add the package to the store without preprocessing
m.Store.AddMemPackage(memPkg)

Check warning on line 285 in gnovm/pkg/gnolang/machine.go

View check run for this annotation

Codecov / codecov/patch

gnovm/pkg/gnolang/machine.go#L285

Added line #L285 was not covered by tests
}
Expand Down

0 comments on commit fd946d4

Please sign in to comment.