Skip to content
This repository has been archived by the owner on Nov 16, 2022. It is now read-only.

Commit

Permalink
chain: Add support for cosmos ledger app in Wenchang
Browse files Browse the repository at this point in the history
  • Loading branch information
sorawit committed May 17, 2020
1 parent 4d67282 commit 547eef8
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions chain/cmd/bandcli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,31 @@ import (
"github.com/tendermint/tendermint/libs/cli"
)

const flagCosmosHDPath = "cosmos-hd-path"

func main() {
cobra.EnableCommandSorting = false

cdc := app.MakeCodec()

// Read in the configuration file for the sdk
config := sdk.GetConfig()
app.SetBech32AddressPrefixesAndBip44CoinType(config)
config.Seal()

rootCmd := &cobra.Command{
Use: "bandcli",
Short: "Command line interface for interacting with BandChain",
}

// Add --chain-id to persistent flags and mark it required
rootCmd.PersistentFlags().String(client.FlagChainID, "", "Chain ID of tendermint node")
rootCmd.PersistentFlags().Bool(flagCosmosHDPath, false, fmt.Sprintf("Use Cosmos BIP-44 coin type (%d)", sdk.CoinType))

rootCmd.PersistentPreRunE = func(_ *cobra.Command, _ []string) error {
// Read in the configuration file for the sdk
config := sdk.GetConfig()
app.SetBech32AddressPrefixesAndBip44CoinType(config)
if viper.GetBool(flagCosmosHDPath) {
fmt.Println("HERE!")
config.SetCoinType(sdk.CoinType)
}
config.Seal()
return initConfig(rootCmd)
}

Expand Down

0 comments on commit 547eef8

Please sign in to comment.