mirror of
https://github.com/fluencelabs/tendermint
synced 2025-05-28 13:41:21 +00:00
remove some assertXxx funcs
This commit is contained in:
parent
796024f42f
commit
1775be1cd9
@ -24,19 +24,10 @@ func New(coder Encoder, store keys.Storage, codec keys.Codec) Manager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// assert Manager satisfies keys.Signer and keys.Manager interfaces
|
||||||
var _ keys.Signer = Manager{}
|
var _ keys.Signer = Manager{}
|
||||||
var _ keys.Manager = Manager{}
|
var _ keys.Manager = Manager{}
|
||||||
|
|
||||||
// exists just to make sure we fulfill the Signer interface
|
|
||||||
func (s Manager) assertSigner() keys.Signer {
|
|
||||||
return s
|
|
||||||
}
|
|
||||||
|
|
||||||
// exists just to make sure we fulfill the Manager interface
|
|
||||||
func (s Manager) assertKeyManager() keys.Manager {
|
|
||||||
return s
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create adds a new key to the storage engine, returning error if
|
// Create adds a new key to the storage engine, returning error if
|
||||||
// another key already stored under this name
|
// another key already stored under this name
|
||||||
//
|
//
|
||||||
|
@ -42,13 +42,9 @@ func New(dir string) FileStore {
|
|||||||
return FileStore{dir}
|
return FileStore{dir}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// assert FileStore satisfies keys.Storage
|
||||||
var _ keys.Storage = FileStore{}
|
var _ keys.Storage = FileStore{}
|
||||||
|
|
||||||
// assertStorage just makes sure we implement the proper Storage interface
|
|
||||||
func (s FileStore) assertStorage() keys.Storage {
|
|
||||||
return s
|
|
||||||
}
|
|
||||||
|
|
||||||
// Put creates two files, one with the public info as json, the other
|
// Put creates two files, one with the public info as json, the other
|
||||||
// with the (encoded) private key as gpg ascii-armor style
|
// with the (encoded) private key as gpg ascii-armor style
|
||||||
func (s FileStore) Put(name string, key []byte, info keys.Info) error {
|
func (s FileStore) Put(name string, key []byte, info keys.Info) error {
|
||||||
|
@ -22,13 +22,9 @@ func New() MemStore {
|
|||||||
return MemStore{}
|
return MemStore{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// assert MemStore satisfies keys.Storage
|
||||||
var _ keys.Storage = MemStore{}
|
var _ keys.Storage = MemStore{}
|
||||||
|
|
||||||
// assertStorage just makes sure we implement the Storage interface
|
|
||||||
func (s MemStore) assertStorage() keys.Storage {
|
|
||||||
return s
|
|
||||||
}
|
|
||||||
|
|
||||||
// Put adds the given key, returns an error if it another key
|
// Put adds the given key, returns an error if it another key
|
||||||
// is already stored under this name
|
// is already stored under this name
|
||||||
func (s MemStore) Put(name string, key []byte, info keys.Info) error {
|
func (s MemStore) Put(name string, key []byte, info keys.Info) error {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user