Merge PR #5345: Add dev docs for COSMOS_SDK_TEST_KEYRING

This commit is contained in:
Alessio Treglia
2019-11-30 09:32:08 -05:00
committed by Alexander Bezobchuk
parent 3196b7c4ca
commit b9cb3e105d
2 changed files with 5 additions and 3 deletions
+3 -1
View File
@@ -46,7 +46,9 @@ func NewKeyringFromHomeFlag(input io.Reader) (keys.Keybase, error) {
return NewKeyringFromDir(viper.GetString(flags.FlagHome), input)
}
// NewKeyBaseFromDir initializes a keybase at a particular dir.
// NewKeyBaseFromDir initializes a keyring at a particular dir.
// If the COSMOS_SDK_TEST_KEYRING environment variable is set and not empty it will
// return an on-disk, password-less keyring that could be used for testing purposes.
func NewKeyringFromDir(rootDir string, input io.Reader) (keys.Keybase, error) {
if os.Getenv("COSMOS_SDK_TEST_KEYRING") != "" {
return keys.NewTestKeyring(sdk.GetConfig().GetKeyringServiceName(), rootDir)