Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: integrate with v0.52.x (1/n) #4289

Merged
merged 27 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from 14 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ node_modules
docs/.vuepress/dist
build/
*coverage.*
*.ign
3 changes: 2 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
- [#4297](https://github.com/ignite/cli/pull/4297) Add in-place testnet creation command for apps.
- [#4300](https://github.com/ignite/cli/pull/4300) Only panics the module in the most top function level
- [#4327](https://github.com/ignite/cli/pull/4327) Use the TxConfig from simState instead create a new one
- [#4326](https://github.com/ignite/cli/pull/4326) fAdd `buf.build` version to `ignite version` command
- [#4326](https://github.com/ignite/cli/pull/4326) Add `buf.build` version to `ignite version` command
- [#4289](https://github.com/ignite/cli/pull/4289) Cosmos SDK v0.52 support

### Changes

Expand Down
149 changes: 83 additions & 66 deletions go.mod

Large diffs are not rendered by default.

492 changes: 154 additions & 338 deletions go.sum

Large diffs are not rendered by default.

58 changes: 25 additions & 33 deletions ignite/cmd/chain_simulate.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,20 @@ import (
)

const (
flagSimappGenesis = "genesis"
flagSimappParams = "params"
flagSimappExportParamsPath = "exportParamsPath"
flagSimappExportParamsHeight = "exportParamsHeight"
flagSimappExportStatePath = "exportStatePath"
flagSimappExportStatsPath = "exportStatsPath"
flagSimappSeed = "seed"
flagSimappInitialBlockHeight = "initialBlockHeight"
flagSimappNumBlocks = "numBlocks"
flagSimappBlockSize = "blockSize"
flagSimappLean = "lean"
flagSimappSimulateEveryOperation = "simulateEveryOperation"
flagSimappPrintAllInvariants = "printAllInvariants"
flagSimappVerbose = "verbose"
flagSimappPeriod = "period"
flagSimappGenesisTime = "genesisTime"
flagSimappGenesis = "genesis"
flagSimappParams = "params"
flagSimappExportParamsPath = "exportParamsPath"
flagSimappExportParamsHeight = "exportParamsHeight"
flagSimappExportStatePath = "exportStatePath"
flagSimappExportStatsPath = "exportStatsPath"
flagSimappSeed = "seed"
flagSimappInitialBlockHeight = "initialBlockHeight"
flagSimappNumBlocks = "numBlocks"
flagSimappBlockSize = "blockSize"
flagSimappLean = "lean"
flagSimappVerbose = "verbose"
flagSimappPeriod = "period"
flagSimappGenesisTime = "genesisTime"
)

// NewChainSimulate creates a new simulation command to run the blockchain simulation.
Expand Down Expand Up @@ -76,19 +74,17 @@ func chainSimulationHandler(cmd *cobra.Command, _ []string) error {
// newConfigFromFlags creates a simulation from the retrieved values of the flags.
func newConfigFromFlags(cmd *cobra.Command) simulation.Config {
var (
genesis, _ = cmd.Flags().GetString(flagSimappGenesis)
params, _ = cmd.Flags().GetString(flagSimappParams)
exportParamsPath, _ = cmd.Flags().GetString(flagSimappExportParamsPath)
exportParamsHeight, _ = cmd.Flags().GetInt(flagSimappExportParamsHeight)
exportStatePath, _ = cmd.Flags().GetString(flagSimappExportStatePath)
exportStatsPath, _ = cmd.Flags().GetString(flagSimappExportStatsPath)
seed, _ = cmd.Flags().GetInt64(flagSimappSeed)
initialBlockHeight, _ = cmd.Flags().GetInt(flagSimappInitialBlockHeight)
numBlocks, _ = cmd.Flags().GetInt(flagSimappNumBlocks)
blockSize, _ = cmd.Flags().GetInt(flagSimappBlockSize)
lean, _ = cmd.Flags().GetBool(flagSimappLean)
simulateEveryOperation, _ = cmd.Flags().GetBool(flagSimappSimulateEveryOperation)
printAllInvariants, _ = cmd.Flags().GetBool(flagSimappPrintAllInvariants)
genesis, _ = cmd.Flags().GetString(flagSimappGenesis)
params, _ = cmd.Flags().GetString(flagSimappParams)
exportParamsPath, _ = cmd.Flags().GetString(flagSimappExportParamsPath)
exportParamsHeight, _ = cmd.Flags().GetInt(flagSimappExportParamsHeight)
exportStatePath, _ = cmd.Flags().GetString(flagSimappExportStatePath)
exportStatsPath, _ = cmd.Flags().GetString(flagSimappExportStatsPath)
seed, _ = cmd.Flags().GetInt64(flagSimappSeed)
initialBlockHeight, _ = cmd.Flags().GetInt(flagSimappInitialBlockHeight)
numBlocks, _ = cmd.Flags().GetInt(flagSimappNumBlocks)
blockSize, _ = cmd.Flags().GetInt(flagSimappBlockSize)
lean, _ = cmd.Flags().GetBool(flagSimappLean)
)
return simulation.Config{
Commit: true,
Expand All @@ -103,8 +99,6 @@ func newConfigFromFlags(cmd *cobra.Command) simulation.Config {
NumBlocks: numBlocks,
BlockSize: blockSize,
Lean: lean,
OnOperation: simulateEveryOperation,
AllInvariants: printAllInvariants,
}
}

Expand All @@ -121,8 +115,6 @@ func simappFlags(c *cobra.Command) {
c.Flags().Int(flagSimappNumBlocks, 200, "number of new blocks to simulate from the initial block height")
c.Flags().Int(flagSimappBlockSize, 30, "operations per block")
c.Flags().Bool(flagSimappLean, false, "lean simulation log output")
c.Flags().Bool(flagSimappSimulateEveryOperation, false, "run slow invariants every operation")
c.Flags().Bool(flagSimappPrintAllInvariants, false, "print all invariants if a broken invariant is found")

// simulation flags
c.Flags().BoolP(flagSimappVerbose, "v", false, "verbose log output")
Expand Down
4 changes: 3 additions & 1 deletion ignite/cmd/scaffold_module.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,14 @@ params.

c.Flags().AddFlagSet(flagSetYes())
c.Flags().StringSlice(flagDep, []string{}, "add a dependency on another module")
c.Flags().Bool(flagIBC, false, "add IBC functionality")
// c.Flags().Bool(flagIBC, false, "add IBC functionality")
c.Flags().String(flagIBCOrdering, "none", "channel ordering of the IBC module [none|ordered|unordered]")
c.Flags().Bool(flagRequireRegistration, false, "fail if module can't be registered")
c.Flags().StringSlice(flagParams, []string{}, "add module parameters")
c.Flags().StringSlice(flagModuleConfigs, []string{}, "add module configs")

_ = c.Flags().MarkDeprecated(flagIBC, "IBC modules are temporarily not supported in Ignite v29 (waiting to IBC compatible version with Cosmos SDK v0.52)") // https://github.com/ignite/cli/pull/4289

return c
}

Expand Down
7 changes: 5 additions & 2 deletions ignite/internal/plugin/testdata/execute_fail/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@ module execute_fail

go 1.23

replace (
github.com/ignite/cli/v29 => ../../../../..
github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.52.0-beta.1
)

require (
github.com/hashicorp/go-plugin v1.6.0
github.com/ignite/cli/v29 v29.0.0
)

replace github.com/ignite/cli/v29 => ../../../../..

require (
dario.cat/mergo v1.0.0 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
Expand Down
7 changes: 5 additions & 2 deletions ignite/internal/plugin/testdata/execute_ok/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@ module execute_ok

go 1.23

replace (
github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.52.0-beta.1
github.com/ignite/cli/v29 => ../../../../..
)

require (
github.com/hashicorp/go-plugin v1.6.0
github.com/ignite/cli/v29 v29.0.0
)

replace github.com/ignite/cli/v29 => ../../../../..

require (
dario.cat/mergo v1.0.0 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
Expand Down
5 changes: 4 additions & 1 deletion ignite/internal/tools/gen-config-doc/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ module github.com/ignite/cli/ignite/internal/tools/gen-config-doc

go 1.23

replace github.com/ignite/cli/v29 => ../../../../
replace (
github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.52.0-beta.1
github.com/ignite/cli/v29 => ../../../../
)

require (
github.com/gobuffalo/genny/v2 v2.1.0
Expand Down
5 changes: 4 additions & 1 deletion ignite/internal/tools/gen-mig-diffs/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ module github.com/ignite/cli/ignite/internal/tools/gen-mig-diffs

go 1.23

replace github.com/ignite/cli/v29 => ../../../../
replace (
github.com/ignite/cli/v29 => ../../../../
github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.52.0-beta.1
)

require (
github.com/Masterminds/semver/v3 v3.2.1
Expand Down
5 changes: 3 additions & 2 deletions ignite/pkg/chaincmd/chaincmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ const (
commandGentx = "gentx"
commandCollectGentxs = "collect-gentxs"
commandValidateGenesis = "validate"
commandExportGenssis = "export"
commandShowNodeID = "show-node-id"
commandStatus = "status"
commandTx = "tx"
commandQuery = "query"
commandUnsafeReset = "unsafe-reset-all"
commandExport = "export"
commandTendermint = "tendermint"
commandTestnetInPlace = "in-place-testnet"

Expand Down Expand Up @@ -492,7 +492,8 @@ func (c ChainCmd) UnsafeResetCommand() step.Option {
// ExportCommand returns the command to export the state of the blockchain into a genesis file.
func (c ChainCmd) ExportCommand() step.Option {
command := []string{
commandExport,
commandGenesis,
commandExportGenssis,
}
return c.daemonCommand(command)
}
Expand Down
2 changes: 0 additions & 2 deletions ignite/pkg/chaincmd/runner/simulate.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ func (r Runner) Simulation(
chaincmd.SimappWithBlockSize(config.BlockSize),
chaincmd.SimappWithLean(config.Lean),
chaincmd.SimappWithCommit(config.Commit),
chaincmd.SimappWithSimulateEveryOperation(config.OnOperation),
chaincmd.SimappWithPrintAllInvariants(config.AllInvariants),
chaincmd.SimappWithEnable(enabled),
chaincmd.SimappWithVerbose(verbose),
chaincmd.SimappWithPeriod(period),
Expand Down
20 changes: 0 additions & 20 deletions ignite/pkg/chaincmd/simulate.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,26 +150,6 @@ func SimappWithCommit(commit bool) SimappOption {
}
}

// SimappWithSimulateEveryOperation provides simulateEveryOperation option for the simapp command.
func SimappWithSimulateEveryOperation(simulateEveryOperation bool) SimappOption {
return func(command []string) []string {
if simulateEveryOperation {
return append(command, optionSimappSimulateEveryOperation)
}
return command
}
}

// SimappWithPrintAllInvariants provides printAllInvariants option for the simapp command.
func SimappWithPrintAllInvariants(printAllInvariants bool) SimappOption {
return func(command []string) []string {
if printAllInvariants {
return append(command, optionSimappPrintAllInvariants)
}
return command
}
}

// SimappWithEnable provides enable option for the simapp command.
func SimappWithEnable(enable bool) SimappOption {
return func(command []string) []string {
Expand Down
2 changes: 1 addition & 1 deletion ignite/pkg/cosmosaccount/cosmosaccount.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ func (r Registry) DeleteByName(name string) error {
}

func (r Registry) hdPath() string {
return hd.CreateHDPath(sdktypes.GetConfig().GetCoinType(), 0, 0).String()
return hd.CreateHDPath(sdktypes.CoinType, 0, 0).String()
}

func (r Registry) algo() (keyring.SignatureAlgo, error) {
Expand Down
Loading
Loading