Skip to content

Commit

Permalink
fix: disable gas auto for gentx cmd
Browse files Browse the repository at this point in the history
Signed-off-by: Artur Troian <[email protected]>
  • Loading branch information
troian committed Oct 29, 2024
1 parent 58879dd commit 7fe522f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions go/cli/genesis_gentx.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"io"
"os"
"path/filepath"
"strconv"

tmtypes "github.com/cometbft/cometbft/types"
"github.com/pkg/errors"
Expand Down Expand Up @@ -54,6 +55,18 @@ $ %s gentx my-key-name 1000000uakt --home=/path/to/home/dir --keyring-backend=os
--website="..."
`, defaultsDesc, version.AppName,
),
PreRunE: func(cmd *cobra.Command, args []string) error {
gas, err := cmd.Flags().GetString(cflags.FlagGas)
if err != nil {
return err
}

Check warning on line 62 in go/cli/genesis_gentx.go

View check run for this annotation

Codecov / codecov/patch

go/cli/genesis_gentx.go#L59-L62

Added lines #L59 - L62 were not covered by tests

if gas == cflags.GasFlagAuto {
cmd.Flags().Set(cflags.FlagGas, strconv.Itoa(cflags.DefaultGasLimit))
}

Check warning on line 66 in go/cli/genesis_gentx.go

View check run for this annotation

Codecov / codecov/patch

go/cli/genesis_gentx.go#L64-L66

Added lines #L64 - L66 were not covered by tests

return nil

Check warning on line 68 in go/cli/genesis_gentx.go

View check run for this annotation

Codecov / codecov/patch

go/cli/genesis_gentx.go#L68

Added line #L68 was not covered by tests
},
RunE: func(cmd *cobra.Command, args []string) error {
stcx := server.GetServerContextFromCmd(cmd)
cctx, err := client.GetClientTxContext(cmd)
Expand Down

0 comments on commit 7fe522f

Please sign in to comment.