@@ -15,6 +15,8 @@ import (
1515 "github.com/sei-protocol/sei-chain/sei-tendermint/types"
1616)
1717
18+ const wasmDirName = "wasm"
19+
1820// MakeResetCommand constructs a command that removes the database of
1921// the specified Tendermint core instance.
2022func MakeResetCommand (conf * config.Config , logger log.Logger ) * cobra.Command {
@@ -100,6 +102,13 @@ func ResetAll(dbDir, privValKeyFile, privValStateFile string, logger log.Logger,
100102 logger .Info ("Removed dbDir" )
101103 }
102104
105+ wasmDir := filepath .Join (homeDir , wasmDirName )
106+ if err := os .RemoveAll (wasmDir ); err == nil {
107+ logger .Info ("Removed wasm directory" , "dir" , wasmDir )
108+ } else {
109+ logger .Error ("error removing wasm directory" , "dir" , wasmDir , "err" , err )
110+ }
111+
103112 // recreate the dbDir since the privVal state needs to live there
104113 return ResetFilePV (filepath .Join (homeDir , privValKeyFile ), filepath .Join (homeDir , privValStateFile ), logger , keyType )
105114}
@@ -198,8 +207,8 @@ func MakeUnsafeResetAllCommand(conf *config.Config, logger log.Logger) *cobra.Co
198207
199208 resetAllCmd := & cobra.Command {
200209 Use : "unsafe-reset-all" ,
201- Short : "Removes all tendermint data including signing state" ,
202- Long : `Removes all tendermint data including signing state.
210+ Short : "Removes all tendermint data, wasm directory, and signing state" ,
211+ Long : `Removes all tendermint data including signing state, and the wasm directory (contract blobs and compiled modules) .
203212Only use in testing. This can cause the node to double sign` ,
204213 RunE : func (cmd * cobra.Command , args []string ) error {
205214 // Get the --home flag value from the command
0 commit comments