From e4bca4817d532460253d9ee31b1a5c8720eb9bbd Mon Sep 17 00:00:00 2001 From: ltacker Date: Mon, 14 Nov 2022 21:51:11 -0500 Subject: [PATCH 1/5] add gas auto --- ignite/cmd/network.go | 1 + 1 file changed, 1 insertion(+) diff --git a/ignite/cmd/network.go b/ignite/cmd/network.go index 5fd18fc15e..c0a5a872d7 100644 --- a/ignite/cmd/network.go +++ b/ignite/cmd/network.go @@ -205,6 +205,7 @@ func getNetworkCosmosClient(cmd *cobra.Command) (cosmosclient.Client, error) { cosmosclient.WithUseFaucet(spnFaucetAddress, networktypes.SPNDenom, 5), cosmosclient.WithKeyringServiceName(cosmosaccount.KeyringServiceName), cosmosclient.WithKeyringDir(getKeyringDir(cmd)), + cosmosclient.WithGas("auto"), } keyringBackend := getKeyringBackend(cmd) From 3eb835b57e34bb4facd97120c5045c1c28a9feee Mon Sep 17 00:00:00 2001 From: ltacker Date: Mon, 14 Nov 2022 22:06:55 -0500 Subject: [PATCH 2/5] comment --- ignite/pkg/cosmosclient/cosmosclient.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ignite/pkg/cosmosclient/cosmosclient.go b/ignite/pkg/cosmosclient/cosmosclient.go index 98e3894749..c895c8a81b 100644 --- a/ignite/pkg/cosmosclient/cosmosclient.go +++ b/ignite/pkg/cosmosclient/cosmosclient.go @@ -571,7 +571,7 @@ func (c Client) CreateTx(goCtx context.Context, account cosmosaccount.Account, m return TxService{}, errors.WithStack(err) } // the simulated gas can vary from the actual gas needed for a real transaction - // we add an additional amount to ensure sufficient gas is provided + // we add an amount to ensure sufficient gas is provided gas += 20000 } txf = txf.WithGas(gas) From a8963429e7560060d34143ca3539458878b7b7c7 Mon Sep 17 00:00:00 2001 From: ltacker Date: Mon, 14 Nov 2022 22:11:31 -0500 Subject: [PATCH 3/5] use constant --- ignite/cmd/network.go | 2 +- ignite/pkg/cosmosclient/cosmosclient.go | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ignite/cmd/network.go b/ignite/cmd/network.go index c0a5a872d7..51402a76e1 100644 --- a/ignite/cmd/network.go +++ b/ignite/cmd/network.go @@ -205,7 +205,7 @@ func getNetworkCosmosClient(cmd *cobra.Command) (cosmosclient.Client, error) { cosmosclient.WithUseFaucet(spnFaucetAddress, networktypes.SPNDenom, 5), cosmosclient.WithKeyringServiceName(cosmosaccount.KeyringServiceName), cosmosclient.WithKeyringDir(getKeyringDir(cmd)), - cosmosclient.WithGas("auto"), + cosmosclient.WithGas(cosmosclient.GasAuto), } keyringBackend := getKeyringBackend(cmd) diff --git a/ignite/pkg/cosmosclient/cosmosclient.go b/ignite/pkg/cosmosclient/cosmosclient.go index c895c8a81b..8b93fd4db7 100644 --- a/ignite/pkg/cosmosclient/cosmosclient.go +++ b/ignite/pkg/cosmosclient/cosmosclient.go @@ -52,6 +52,9 @@ var ( ) const ( + // GasAuto allows to calulate gas automatically when sending transaction + GasAuto = "auto" + defaultNodeAddress = "http://localhost:26657" defaultGasAdjustment = 1.0 defaultGasLimit = 300000 @@ -560,7 +563,7 @@ func (c Client) CreateTx(goCtx context.Context, account cosmosaccount.Account, m } var gas uint64 - if c.gas != "" && c.gas != "auto" { + if c.gas != "" && c.gas != GasAuto { gas, err = strconv.ParseUint(c.gas, 10, 64) if err != nil { return TxService{}, errors.WithStack(err) From 9a69a98b706c6c8093c7566d485a22bdd114a184 Mon Sep 17 00:00:00 2001 From: ltacker Date: Mon, 14 Nov 2022 22:17:33 -0500 Subject: [PATCH 4/5] changelog --- changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 499653d6bf..dd65af8861 100644 --- a/changelog.md +++ b/changelog.md @@ -42,7 +42,7 @@ ### Fixes - +- [#3114](https://github.com/ignite/cli/pull/3114) Fix out of gas issue when approving many requests - [#3068](https://github.com/ignite/cli/pull/3068) Fix REST codegen method casing bug - [#3031](https://github.com/ignite/cli/pull/3031) Move keeper hooks to after all keepers initialized in `app.go` template. From 72b8dc0ccfe2e044ad73ce819ac5f7e04ff7439f Mon Sep 17 00:00:00 2001 From: aljo242 Date: Tue, 15 Nov 2022 08:38:05 -0500 Subject: [PATCH 5/5] minor lint fix --- ignite/pkg/cosmosclient/cosmosclient.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ignite/pkg/cosmosclient/cosmosclient.go b/ignite/pkg/cosmosclient/cosmosclient.go index 8b93fd4db7..3c9e6837bc 100644 --- a/ignite/pkg/cosmosclient/cosmosclient.go +++ b/ignite/pkg/cosmosclient/cosmosclient.go @@ -52,7 +52,7 @@ var ( ) const ( - // GasAuto allows to calulate gas automatically when sending transaction + // GasAuto allows to calculate gas automatically when sending transaction GasAuto = "auto" defaultNodeAddress = "http://localhost:26657"