Skip to content

Commit

Permalink
feat(crypto/keyring): expose db keyring used in the keystore (#20212)
Browse files Browse the repository at this point in the history
Co-authored-by: Julien Robert <julien@rbrt.fr>
  • Loading branch information
mmsqe and julienrbrt authored May 9, 2024
1 parent 990f415 commit c4308d2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i
* (x/consensus) [#19483](https://github.com/cosmos/cosmos-sdk/pull/19483) Add consensus messages registration to consensus module.
* (types) [#19759](https://github.com/cosmos/cosmos-sdk/pull/19759) Align SignerExtractionAdapter in PriorityNonceMempool Remove.
* (client) [#19870](https://github.com/cosmos/cosmos-sdk/pull/19870) Add new query command `wait-tx`. Alias `event-query-tx-for` to `wait-tx` for backward compatibility.
* (crypto/keyring) [#20212](https://github.com/cosmos/cosmos-sdk/pull/20212) Expose the db keyring used in the keystore.
* (genutil) [#19971](https://github.com/cosmos/cosmos-sdk/pull/19971) Allow manually setting the consensus key type in genesis

### Improvements
Expand Down
9 changes: 9 additions & 0 deletions crypto/keyring/keyring.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ var (
type Keyring interface {
// Backend get the backend type used in the keyring config: "file", "os", "kwallet", "pass", "test", "memory".
Backend() string

// Get the db keyring used in the keystore.
DB() keyring.Keyring

// List all keys.
List() ([]*Record, error)

Expand Down Expand Up @@ -256,6 +260,11 @@ func (ks keystore) Backend() string {
return ks.backend
}

// DB returns the db keyring used in the keystore
func (ks keystore) DB() keyring.Keyring {
return ks.db
}

func (ks keystore) ExportPubKeyArmor(uid string) (string, error) {
k, err := ks.Key(uid)
if err != nil {
Expand Down

0 comments on commit c4308d2

Please sign in to comment.