Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions contribs/gnobro/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,12 @@ require (
github.com/rogpeppe/go-internal v1.14.1 // indirect
github.com/rs/cors v1.11.1 // indirect
github.com/rs/xid v1.6.0 // indirect
github.com/ryanuber/columnize v2.1.2+incompatible // indirect
github.com/sig-0/insertion-queue v0.0.0-20241004125609-6b3ca841346b // indirect
github.com/stretchr/testify v1.10.0 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/xlab/treeprint v1.2.0 // indirect
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
github.com/yuin/goldmark v1.7.8 // indirect
github.com/yuin/goldmark-emoji v1.0.2 // indirect
Expand Down
4 changes: 4 additions & 0 deletions contribs/gnobro/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions contribs/gnodev/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,11 @@ require (
github.com/rogpeppe/go-internal v1.14.1 // indirect
github.com/rs/cors v1.11.1 // indirect
github.com/rs/xid v1.6.0 // indirect
github.com/ryanuber/columnize v2.1.2+incompatible // indirect
github.com/sig-0/insertion-queue v0.0.0-20241004125609-6b3ca841346b // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/xlab/treeprint v1.2.0 // indirect
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
github.com/yuin/goldmark v1.7.8 // indirect
github.com/yuin/goldmark-highlighting/v2 v2.0.0-20230729083705-37449abec8cc // indirect
Expand Down
4 changes: 4 additions & 0 deletions contribs/gnodev/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions contribs/gnogenesis/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ require (
github.com/rogpeppe/go-internal v1.14.1 // indirect
github.com/rs/cors v1.11.1 // indirect
github.com/rs/xid v1.6.0 // indirect
github.com/ryanuber/columnize v2.1.2+incompatible // indirect
github.com/sig-0/insertion-queue v0.0.0-20241004125609-6b3ca841346b // indirect
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/xlab/treeprint v1.2.0 // indirect
github.com/zondax/hid v0.9.2 // indirect
github.com/zondax/ledger-go v0.14.3 // indirect
go.etcd.io/bbolt v1.3.11 // indirect
Expand Down
4 changes: 4 additions & 0 deletions contribs/gnogenesis/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions contribs/gnokeykc/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@ require (
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.23.0 // indirect
github.com/rs/xid v1.6.0 // indirect
github.com/ryanuber/columnize v2.1.2+incompatible // indirect
github.com/sig-0/insertion-queue v0.0.0-20241004125609-6b3ca841346b // indirect
github.com/stretchr/testify v1.10.0 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/xlab/treeprint v1.2.0 // indirect
github.com/zondax/hid v0.9.2 // indirect
github.com/zondax/ledger-go v0.14.3 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
Expand Down
4 changes: 4 additions & 0 deletions contribs/gnokeykc/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions contribs/gnomigrate/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions contribs/tx-archive/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions gno.land/pkg/gnoclient/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,19 @@ import (

"github.com/gnolang/gno/tm2/pkg/amino"
abciErrors "github.com/gnolang/gno/tm2/pkg/bft/abci/example/errors"
"github.com/gnolang/gno/tm2/pkg/gas"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/gnolang/gno/gno.land/pkg/gnoland/ugnot"
"github.com/gnolang/gno/gno.land/pkg/keyscli"
"github.com/gnolang/gno/gno.land/pkg/sdk/vm"
"github.com/gnolang/gno/gnovm/stdlibs/chain"
abci "github.com/gnolang/gno/tm2/pkg/bft/abci/types"
ctypes "github.com/gnolang/gno/tm2/pkg/bft/rpc/core/types"
"github.com/gnolang/gno/tm2/pkg/bft/types"
"github.com/gnolang/gno/tm2/pkg/crypto"
"github.com/gnolang/gno/tm2/pkg/crypto/keys"
"github.com/gnolang/gno/tm2/pkg/crypto/keys/client"
"github.com/gnolang/gno/tm2/pkg/sdk/bank"
"github.com/gnolang/gno/tm2/pkg/std"
)
Expand Down Expand Up @@ -1529,7 +1530,7 @@ func TestClient_EstimateGas(t *testing.T) {
t.Parallel()

var (
gasUsed = int64(100000)
gasUsed = gas.GasDetail{Total: gas.Detail{OperationCount: 1, GasConsumed: 100000}}
deliverResp = &abci.ResponseDeliverTx{
GasUsed: gasUsed,
}
Expand Down Expand Up @@ -1565,14 +1566,14 @@ func TestClient_EstimateGas(t *testing.T) {
estimate, err := c.EstimateGas(&std.Tx{})

require.NoError(t, err)
assert.Equal(t, gasUsed, estimate)
assert.Equal(t, gasUsed.Total.GasConsumed, estimate)
})

t.Run("valid simulate", func(t *testing.T) {
t.Parallel()

var (
gasUsed = int64(100000)
gasUsed = gas.GasDetail{Total: gas.Detail{OperationCount: 1, GasConsumed: 100000}}
deliverResp = &abci.ResponseDeliverTx{
GasUsed: gasUsed,
ResponseBase: abci.ResponseBase{
Expand Down Expand Up @@ -1618,7 +1619,7 @@ func TestClient_EstimateGas(t *testing.T) {
require.NoError(t, err)
assert.Equal(t, gasUsed, deliverTx.GasUsed)

bytesDelta, coinsDelta, hasStorageEvents := keyscli.GetStorageInfo(deliverTx.Events)
bytesDelta, coinsDelta, hasStorageEvents := client.GetStorageInfo(deliverTx.Events)
assert.Equal(t, true, hasStorageEvents)
assert.Equal(t, int64(10), bytesDelta)
assert.Equal(t, "1000ugnot", coinsDelta.String())
Expand Down
2 changes: 1 addition & 1 deletion gno.land/pkg/gnoclient/client_txs.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ func (c *Client) EstimateGas(tx *std.Tx) (int64, error) {

// Return the actual value returned by the node
// for executing the transaction
return deliverTx.GasUsed, nil
return deliverTx.GasUsed.Total.GasConsumed, nil
}

// Simulate the transaction and return the ResponseDeliverTx.
Expand Down
3 changes: 2 additions & 1 deletion gno.land/pkg/gnoland/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
dbm "github.com/gnolang/gno/tm2/pkg/db"
"github.com/gnolang/gno/tm2/pkg/db/memdb"
"github.com/gnolang/gno/tm2/pkg/events"
"github.com/gnolang/gno/tm2/pkg/gas"
"github.com/gnolang/gno/tm2/pkg/log"
"github.com/gnolang/gno/tm2/pkg/sdk"
"github.com/gnolang/gno/tm2/pkg/sdk/auth"
Expand Down Expand Up @@ -1099,7 +1100,7 @@ func newGasPriceTestApp(t *testing.T) abci.Application {

count := getTotalCount(tx)

newCtx.GasMeter().ConsumeGas(count, "counter-ante")
newCtx.GasMeter().ConsumeGas(gas.OpTesting, float64(count))
res = sdk.Result{
GasWanted: getTotalCount(tx),
}
Expand Down
Loading
Loading