Skip to content

Commit

Permalink
fix: use correct committee params (#640)
Browse files Browse the repository at this point in the history
  • Loading branch information
karzak authored Aug 30, 2020
1 parent a53fbc3 commit dbb8f38
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 765 deletions.
34 changes: 0 additions & 34 deletions cmd/kvd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,14 @@ import (

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/server"
srvconfig "github.com/cosmos/cosmos-sdk/server/config"
"github.com/cosmos/cosmos-sdk/store"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/auth"
genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli"
"github.com/cosmos/cosmos-sdk/x/staking"

"github.com/kava-labs/kava/app"
kava3 "github.com/kava-labs/kava/contrib/kava-3"
"github.com/kava-labs/kava/migrate"
)

Expand Down Expand Up @@ -56,7 +53,6 @@ func main() {
genutilcli.InitCmd(ctx, cdc, app.ModuleBasics, app.DefaultNodeHome),
genutilcli.CollectGenTxsCmd(ctx, cdc, auth.GenesisAccountIterator{}, app.DefaultNodeHome),
migrate.MigrateGenesisCmd(ctx, cdc),
writeParamsAndConfigCmd(cdc),
genutilcli.GenTxCmd(
ctx,
cdc,
Expand Down Expand Up @@ -144,33 +140,3 @@ func persistentPreRunEFn(ctx *server.Context) func(*cobra.Command, []string) err
return nil
}
}

// writeParamsAndConfigCmd patches the write-params cmd to additionally update the app pruning config.
func writeParamsAndConfigCmd(cdc *codec.Codec) *cobra.Command {
cmd := kava3.WriteGenesisParamsCmd(cdc)
originalFunc := cmd.RunE

wrappedFunc := func(cmd *cobra.Command, args []string) error {

if err := originalFunc(cmd, args); err != nil {
return err
}

// fetch the app config from viper
cfg, err := srvconfig.ParseConfig()
if err != nil {
return nil // don't return errors since as failures aren't critical
}
// don't prune any state, ie store everything
cfg.Pruning = store.PruningStrategyNothing
// write updated config
if viper.ConfigFileUsed() == "" {
return nil
}
srvconfig.WriteConfigFile(viper.ConfigFileUsed(), cfg)
return nil
}

cmd.RunE = wrappedFunc
return cmd
}
77 changes: 0 additions & 77 deletions contrib/kava-3/cmd.go

This file was deleted.

168 changes: 0 additions & 168 deletions contrib/kava-3/migration.md

This file was deleted.

Loading

0 comments on commit dbb8f38

Please sign in to comment.