mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
Add type hints to peer folder
This commit is contained in:
@ -1,13 +1,20 @@
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import (
|
||||
Any,
|
||||
)
|
||||
|
||||
from .id import (
|
||||
ID,
|
||||
)
|
||||
|
||||
|
||||
class IPeerMetadata(ABC):
|
||||
|
||||
def __init__(self):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def get(self, peer_id, key):
|
||||
def get(self, peer_id: ID, key: Any) -> Any:
|
||||
"""
|
||||
:param peer_id: peer ID to lookup key for
|
||||
:param key: key to look up
|
||||
@ -16,7 +23,7 @@ class IPeerMetadata(ABC):
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
def put(self, peer_id, key, val):
|
||||
def put(self, peer_id: ID, key: Any, val: Any) -> None:
|
||||
"""
|
||||
:param peer_id: peer ID to lookup key for
|
||||
:param key: key to associate with peer
|
||||
|
||||
Reference in New Issue
Block a user