mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
Apply PR feedback: add_key_pair
This commit is contained in:
@ -3,7 +3,7 @@ from typing import Any, List, Sequence, Set
|
||||
|
||||
from multiaddr import Multiaddr
|
||||
|
||||
from libp2p.crypto.keys import PrivateKey, PublicKey
|
||||
from libp2p.crypto.keys import KeyPair, PrivateKey, PublicKey
|
||||
|
||||
from .addrbook_interface import IAddrBook
|
||||
from .id import ID
|
||||
@ -131,6 +131,14 @@ class IPeerStore(IAddrBook, IPeerMetadata):
|
||||
:raise PeerStoreError: if peer ID not found
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
def add_key_pair(self, peer_id: ID, key_pair: KeyPair) -> None:
|
||||
"""
|
||||
:param peer_id: peer ID to add private key for
|
||||
:param key_pair:
|
||||
:raise PeerStoreError: if peer ID already has pubkey or privkey set
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
def peers_with_keys(self) -> Set[ID]:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user