-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adjust use of baseapp by adding Tx decoder and adjust root cmd to use…
… correct mempool and baseapp options
- Loading branch information
1 parent
3cad940
commit ea877ce
Showing
4 changed files
with
109 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package config | ||
|
||
import ( | ||
"github.com/cosmos/cosmos-sdk/client/config" | ||
"github.com/spf13/viper" | ||
"path/filepath" | ||
) | ||
|
||
// GetChainIDFromHome returns the chain ID from the client configuration | ||
// in the given home directory. | ||
func GetChainIDFromHome(home string) (string, error) { | ||
v := viper.New() | ||
v.AddConfigPath(filepath.Join(home, "config")) | ||
v.SetConfigName("client") | ||
v.SetConfigType("toml") | ||
|
||
if err := v.ReadInConfig(); err != nil { | ||
return "", err | ||
} | ||
conf := new(config.ClientConfig) | ||
|
||
if err := v.Unmarshal(conf); err != nil { | ||
return "", err | ||
} | ||
|
||
return conf.ChainID, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters