Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename InfoImporter -> LegacyInfoImporter (bp #8739) #8740

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions client/keys/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,15 @@ func runMigrateCmd(cmd *cobra.Command, args []string) error {
}

if keyType != keyring.TypeLocal {
<<<<<<< HEAD
pubkeyArmor, err := legacyKb.ExportPubKey(keyName)
if err != nil {
return err
=======
infoImporter, ok := migrator.(keyring.LegacyInfoImporter)
if !ok {
return fmt.Errorf("the Keyring implementation does not support import operations of Info types")
>>>>>>> 010eeef45... Rename InfoImporter -> LegacyInfoImporter (#8739)
}

if err := migrator.ImportPubKey(keyName, pubkeyArmor); err != nil {
Expand Down
10 changes: 10 additions & 0 deletions crypto/keyring/keyring.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,16 @@ type Importer interface {
ImportPubKey(uid string, armor string) error
}

<<<<<<< HEAD
=======
// LegacyInfoImporter is implemented by key stores that support import of Info types.
type LegacyInfoImporter interface {
// ImportInfo import a keyring.Info into the current keyring.
// It is used to migrate multisig, ledger, and public key Info structure.
ImportInfo(oldInfo Info) error
}

>>>>>>> 010eeef45... Rename InfoImporter -> LegacyInfoImporter (#8739)
// Exporter is implemented by key stores that support export of public and private keys.
type Exporter interface {
// Export public key
Expand Down