feat(crypto/keyring): expose db keyring used in the keystore (#24040)
Co-authored-by: Alex | Interchain Labs <alex@interchainlabs.io> Co-authored-by: Tyler <48813565+technicallyty@users.noreply.github.com>
This commit is contained in:
parent
f6fa4f25bd
commit
454467d081
@ -40,6 +40,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
|
||||
|
||||
### Features
|
||||
|
||||
* (crypto/keyring) [#24040](https://github.com/cosmos/cosmos-sdk/pull/24040) Expose the db keyring used in the keystore.
|
||||
* (types) [#23919](https://github.com/cosmos/cosmos-sdk/pull/23919) Add MustValAddressFromBech32 function.
|
||||
* (all) [#23708](https://github.com/cosmos/cosmos-sdk/pull/23708) Add unordered transaction support.
|
||||
* Adds a `--timeout-timestamp` flag that allows users to specify a block time at which the unordered transactions should expire from the mempool.
|
||||
|
||||
@ -50,8 +50,9 @@ const (
|
||||
)
|
||||
|
||||
var (
|
||||
_ Keyring = &keystore{}
|
||||
maxPassphraseEntryAttempts = 3
|
||||
_ Keyring = &keystore{}
|
||||
_ KeyringWithDB = &keystore{}
|
||||
maxPassphraseEntryAttempts = 3
|
||||
)
|
||||
|
||||
// Keyring exposes operations over a backend supported by github.com/99designs/keyring.
|
||||
@ -104,6 +105,13 @@ type Keyring interface {
|
||||
Migrator
|
||||
}
|
||||
|
||||
type KeyringWithDB interface {
|
||||
Keyring
|
||||
|
||||
// Get the db keyring used in the keystore.
|
||||
DB() keyring.Keyring
|
||||
}
|
||||
|
||||
// Signer is implemented by key stores that want to provide signing capabilities.
|
||||
type Signer interface {
|
||||
// Sign sign byte messages with a user key.
|
||||
@ -258,6 +266,11 @@ func (ks keystore) ExportPubKeyArmor(uid string) (string, error) {
|
||||
return crypto.ArmorPubKeyBytes(bz, key.Type()), nil
|
||||
}
|
||||
|
||||
// DB returns the db keyring used in the keystore
|
||||
func (ks keystore) DB() keyring.Keyring {
|
||||
return ks.db
|
||||
}
|
||||
|
||||
func (ks keystore) ExportPubKeyArmorByAddress(address sdk.Address) (string, error) {
|
||||
k, err := ks.KeyByAddress(address)
|
||||
if err != nil {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user