refactor!: migrate Cosmos SDK to CometBFT (#14897)

This commit is contained in:
Julien Robert
2023-02-05 14:51:33 +01:00
committed by GitHub
parent 6978710699
commit 41a3dfeced
391 changed files with 3405 additions and 2984 deletions
+5 -2
View File
@@ -3,14 +3,16 @@ package server
import (
"fmt"
tmcmd "github.com/cometbft/cometbft/cmd/cometbft/commands"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/server/types"
"github.com/spf13/cobra"
tmcmd "github.com/tendermint/tendermint/cmd/tendermint/commands"
)
// NewRollbackCmd creates a command to rollback tendermint and multistore state by one height.
func NewRollbackCmd(appCreator types.AppCreator, defaultNodeHome string) *cobra.Command {
var removeBlock bool
cmd := &cobra.Command{
Use: "rollback",
Short: "rollback cosmos-sdk and tendermint state by one height",
@@ -32,7 +34,7 @@ application.
}
app := appCreator(ctx.Logger, db, nil, ctx.Viper)
// rollback tendermint state
height, hash, err := tmcmd.RollbackState(ctx.Config)
height, hash, err := tmcmd.RollbackState(ctx.Config, removeBlock)
if err != nil {
return fmt.Errorf("failed to rollback tendermint state: %w", err)
}
@@ -48,5 +50,6 @@ application.
}
cmd.Flags().String(flags.FlagHome, defaultNodeHome, "The application home directory")
cmd.Flags().BoolVar(&removeBlock, "hard", false, "remove last block as well as state")
return cmd
}