Skip to content

Commit

Permalink
remove test boolean flag from NewKeybaseKeyring
Browse files Browse the repository at this point in the history
  • Loading branch information
Alessio Treglia committed Sep 24, 2019
1 parent e4c3483 commit dcf9754
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion client/keys/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func runMigrateCmd(cmd *cobra.Command, args []string) error {
if viper.GetBool(flags.FlagDryRun) {
keyring = keys.NewTestKeybaseKeyring(types.GetConfig().GetKeyringServiceName(), rootDir)
} else {
keyring = keys.NewKeybaseKeyring(types.GetConfig().GetKeyringServiceName(), rootDir, buf, false)
keyring = keys.NewKeybaseKeyring(types.GetConfig().GetKeyringServiceName(), rootDir, buf)
}

for _, key := range oldKeys {
Expand Down
7 changes: 4 additions & 3 deletions crypto/keys/lazy_keybase_keyring.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,19 @@ type lazyKeybaseKeyring struct {

// NewKeybaseKeyring creates a new instance of a lazy keybase using a Keyring as
// the persistence layer.
func NewKeybaseKeyring(name string, dir string, userInput io.Reader, test bool) Keybase {
func NewKeybaseKeyring(name string, dir string, userInput io.Reader) Keybase {
_, err := keyring.Open(keyring.Config{
ServiceName: name,
})
if err != nil {
panic(err)
}

return lazyKeybaseKeyring{name: name, dir: dir, userInput: userInput, test: test}
return lazyKeybaseKeyring{name: name, dir: dir, userInput: userInput, test: false}
}

// New creates a new instance of a lazy keybase.
// NewTestKeybaseKeyring creates a new instance of a keyring keybase
// for testing purposes that does not prompt users for password.
func NewTestKeybaseKeyring(name string, dir string) Keybase {
if _, err := keyring.Open(keyring.Config{
AllowedBackends: []keyring.BackendType{"file"},
Expand Down

0 comments on commit dcf9754

Please sign in to comment.