Skip to content

Commit

Permalink
remove unexisting verbose simulation flags
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt committed Oct 13, 2024
1 parent 6b537a5 commit 6423b35
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 47 deletions.
4 changes: 0 additions & 4 deletions ignite/cmd/chain_simulate.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ const (
flagSimappNumBlocks = "numBlocks"
flagSimappBlockSize = "blockSize"
flagSimappLean = "lean"
flagSimappVerbose = "verbose"
flagSimappPeriod = "period"
flagSimappGenesisTime = "genesisTime"
)
Expand All @@ -42,7 +41,6 @@ func NewChainSimulate() *cobra.Command {

func chainSimulationHandler(cmd *cobra.Command, _ []string) error {
var (
verbose, _ = cmd.Flags().GetBool(flagSimappVerbose)
period, _ = cmd.Flags().GetUint(flagSimappPeriod)
genesisTime, _ = cmd.Flags().GetInt64(flagSimappGenesisTime)
config = newConfigFromFlags(cmd)
Expand All @@ -64,7 +62,6 @@ func chainSimulationHandler(cmd *cobra.Command, _ []string) error {
}

return c.Simulate(cmd.Context(),
chain.SimappWithVerbose(verbose),
chain.SimappWithPeriod(period),
chain.SimappWithGenesisTime(genesisTime),
chain.SimappWithConfig(config),
Expand Down Expand Up @@ -117,7 +114,6 @@ func simappFlags(c *cobra.Command) {
c.Flags().Bool(flagSimappLean, false, "lean simulation log output")

// simulation flags
c.Flags().BoolP(flagSimappVerbose, "v", false, "verbose log output")
c.Flags().Uint(flagSimappPeriod, 0, "run slow invariants only once every period assertions")
c.Flags().Int64(flagSimappGenesisTime, 0, "override genesis UNIX time instead of using a random UNIX time")
}
2 changes: 0 additions & 2 deletions ignite/pkg/chaincmd/runner/simulate.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ func (r Runner) Simulation(
ctx context.Context,
appPath string,
enabled bool,
verbose bool,
config simulation.Config,
period uint,
genesisTime int64,
Expand All @@ -35,7 +34,6 @@ func (r Runner) Simulation(
chaincmd.SimappWithLean(config.Lean),
chaincmd.SimappWithCommit(config.Commit),
chaincmd.SimappWithEnable(enabled),
chaincmd.SimappWithVerbose(verbose),
chaincmd.SimappWithPeriod(period),
chaincmd.SimappWithGenesisTime(genesisTime),
))
Expand Down
43 changes: 15 additions & 28 deletions ignite/pkg/chaincmd/simulate.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,21 @@ import (
)

const (
optionSimappGenesis = "-Genesis"
optionSimappParams = "-Params"
optionSimappExportParamsPath = "-ExportParamsPath"
optionSimappExportParamsHeight = "-ExportParamsHeight"
optionSimappExportStatePath = "-ExportStatePath"
optionSimappExportStatsPath = "-ExportStatsPath"
optionSimappSeed = "-Seed"
optionSimappInitialBlockHeight = "-InitialBlockHeight"
optionSimappNumBlocks = "-NumBlocks"
optionSimappBlockSize = "-BlockSize"
optionSimappLean = "-Lean"
optionSimappCommit = "-Commit"
optionSimappSimulateEveryOperation = "-SimulateEveryOperation"
optionSimappPrintAllInvariants = "-PrintAllInvariants"
optionSimappEnabled = "-Enabled"
optionSimappVerbose = "-Verbose"
optionSimappPeriod = "-Period"
optionSimappGenesisTime = "-GenesisTime"
optionSimappGenesis = "-Genesis"
optionSimappParams = "-Params"
optionSimappExportParamsPath = "-ExportParamsPath"
optionSimappExportParamsHeight = "-ExportParamsHeight"
optionSimappExportStatePath = "-ExportStatePath"
optionSimappExportStatsPath = "-ExportStatsPath"
optionSimappSeed = "-Seed"
optionSimappInitialBlockHeight = "-InitialBlockHeight"
optionSimappNumBlocks = "-NumBlocks"
optionSimappBlockSize = "-BlockSize"
optionSimappLean = "-Lean"
optionSimappCommit = "-Commit"
optionSimappEnabled = "-Enabled"
optionSimappPeriod = "-Period"
optionSimappGenesisTime = "-GenesisTime"

commandGoTest = "test"
optionGoBenchmem = "-benchmem"
Expand Down Expand Up @@ -160,16 +157,6 @@ func SimappWithEnable(enable bool) SimappOption {
}
}

// SimappWithVerbose provides verbose option for the simapp command.
func SimappWithVerbose(verbose bool) SimappOption {
return func(command []string) []string {
if verbose {
return append(command, optionSimappVerbose)
}
return command
}
}

// SimappWithPeriod provides period option for the simapp command.
func SimappWithPeriod(period uint) SimappOption {
return func(command []string) []string {
Expand Down
4 changes: 2 additions & 2 deletions ignite/pkg/cosmosclient/cosmosclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ import (
"cosmossdk.io/core/transaction"
banktypes "cosmossdk.io/x/bank/types"
staking "cosmossdk.io/x/staking/types"
authtx "github.com/cosmos/cosmos-sdk/x/auth/tx"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
Expand All @@ -34,6 +32,8 @@ import (
sdktypes "github.com/cosmos/cosmos-sdk/types"
txtypes "github.com/cosmos/cosmos-sdk/types/tx"
"github.com/cosmos/cosmos-sdk/types/tx/signing"
authtx "github.com/cosmos/cosmos-sdk/x/auth/tx"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"

rpcclient "github.com/cometbft/cometbft/rpc/client"
rpchttp "github.com/cometbft/cometbft/rpc/client/http"
Expand Down
3 changes: 2 additions & 1 deletion ignite/pkg/cosmosclient/gasometer.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package cosmosclient

import (
"cosmossdk.io/core/transaction"
gogogrpc "github.com/cosmos/gogoproto/grpc"

"cosmossdk.io/core/transaction"

"github.com/cosmos/cosmos-sdk/client/tx"
txtypes "github.com/cosmos/cosmos-sdk/types/tx"
)
Expand Down
10 changes: 0 additions & 10 deletions ignite/services/chain/simulate.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (

type simappOptions struct {
enabled bool
verbose bool
config simulation.Config
period uint
genesisTime int64
Expand All @@ -20,7 +19,6 @@ func newSimappOptions() simappOptions {
Commit: true,
},
enabled: true,
verbose: false,
period: 0,
genesisTime: 0,
}
Expand All @@ -29,13 +27,6 @@ func newSimappOptions() simappOptions {
// SimappOption provides options for the simapp command.
type SimappOption func(*simappOptions)

// SimappWithVerbose enable the verbose mode.
func SimappWithVerbose(verbose bool) SimappOption {
return func(c *simappOptions) {
c.verbose = verbose
}
}

// SimappWithPeriod allows running slow invariants only once every period assertions.
func SimappWithPeriod(period uint) SimappOption {
return func(c *simappOptions) {
Expand Down Expand Up @@ -72,7 +63,6 @@ func (c *Chain) Simulate(ctx context.Context, options ...SimappOption) error {
return commands.Simulation(ctx,
c.app.Path,
simappOptions.enabled,
simappOptions.verbose,
simappOptions.config,
simappOptions.period,
simappOptions.genesisTime,
Expand Down

0 comments on commit 6423b35

Please sign in to comment.