* Start system tests * Go mod tidy * Add system tests (#1411) * Add tests * Add test-system to CI * Fix path * Remove store artifact steps * Add small fixes * Add stake/unstake tests * Add unsafe-reset-all extention + system test * Replace ustake with stake * Add more tests + fix bug in cli * Fix comments and add multi contract system test * Updates and fixes to system tests (#1449) * Updates * Minor cleanup * Make tests pass --------- Co-authored-by: Alexander Peters <alpe@users.noreply.github.com> * Fix Makefile to return exit code for system tests (#1450) * Abort on error results --------- Co-authored-by: pinosu <95283998+pinosu@users.noreply.github.com>
35 lines
824 B
Go
35 lines
824 B
Go
package cli
|
|
|
|
import (
|
|
"os"
|
|
"path/filepath"
|
|
|
|
"github.com/cosmos/cosmos-sdk/server"
|
|
"github.com/spf13/cobra"
|
|
|
|
tmcmd "github.com/cometbft/cometbft/cmd/cometbft/commands"
|
|
)
|
|
|
|
// ExtendUnsafeResetAllCmd - also clear wasm dir
|
|
func ExtendUnsafeResetAllCmd(rootCmd *cobra.Command) {
|
|
unsafeResetCmd := tmcmd.ResetAllCmd.Use
|
|
for _, branchCmd := range rootCmd.Commands() {
|
|
if branchCmd.Use != "tendermint" {
|
|
continue
|
|
}
|
|
for _, cmd := range branchCmd.Commands() {
|
|
if cmd.Use == unsafeResetCmd {
|
|
serverRunE := cmd.RunE
|
|
cmd.RunE = func(cmd *cobra.Command, args []string) error {
|
|
if err := serverRunE(cmd, args); err != nil {
|
|
return nil
|
|
}
|
|
serverCtx := server.GetServerContextFromCmd(cmd)
|
|
return os.RemoveAll(filepath.Join(serverCtx.Config.RootDir, "wasm"))
|
|
}
|
|
return
|
|
}
|
|
}
|
|
}
|
|
}
|