Skip to content

Commit

Permalink
add Consensus address to autocliopts
Browse files Browse the repository at this point in the history
  • Loading branch information
hoangdv2429 committed Aug 21, 2023
1 parent 6edacfe commit da28ad4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
1 change: 1 addition & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -1045,6 +1045,7 @@ func (app *WasmApp) AutoCliOpts() autocli.AppOptions {
Modules: modules,
AddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()),
ValidatorAddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ValidatorAddrPrefix()),
ConsensusAddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ConsensusAddrPrefix()),
}
}

Expand Down
17 changes: 7 additions & 10 deletions cmd/wasmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ package main
import (
"os"

dbm "github.com/cosmos/cosmos-db"
"github.com/spf13/cobra"

"cosmossdk.io/log"

dbm "github.com/cosmos/cosmos-db"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/config"
"github.com/cosmos/cosmos-sdk/codec"
Expand All @@ -18,6 +16,7 @@ import (
"github.com/cosmos/cosmos-sdk/x/auth/tx"
txmodule "github.com/cosmos/cosmos-sdk/x/auth/tx/config"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/spf13/cobra"

"github.com/CosmWasm/wasmd/app"
"github.com/CosmWasm/wasmd/app/params"
Expand Down Expand Up @@ -48,9 +47,8 @@ func NewRootCmd() *cobra.Command {
WithViper("") // In wasmd, we don't use any prefix for env variables.

rootCmd := &cobra.Command{
Use: version.AppName,
Short: "Wasm Daemon (server)",
SilenceErrors: true,
Use: version.AppName,
Short: "Wasm Daemon (server)",
PersistentPreRunE: func(cmd *cobra.Command, _ []string) error {
// set the default command outputs
cmd.SetOut(cmd.OutOrStdout())
Expand Down Expand Up @@ -96,10 +94,9 @@ func NewRootCmd() *cobra.Command {

initRootCmd(rootCmd, encodingConfig.TxConfig, encodingConfig.InterfaceRegistry, encodingConfig.Codec, tempApp.BasicModuleManager)

// Missing "consensus address codec in builder"
// if err := tempApp.AutoCliOpts().EnhanceRootCommand(rootCmd); err != nil {
// panic(err)
// }
if err := tempApp.AutoCliOpts().EnhanceRootCommand(rootCmd); err != nil {
panic(err)
}

return rootCmd
}

0 comments on commit da28ad4

Please sign in to comment.