Skip to content

Commit

Permalink
Blacklist fixes + depreciation of old signatures (#1240)
Browse files Browse the repository at this point in the history
* fixes blacklist error message + remove

* remove checks for parse signature

* remove sign v1 tests

* fix for the syanpse checks

* fix tests and remove duplicate sign
  • Loading branch information
Eugene-hu authored and ifrit98 committed Jun 7, 2023
1 parent 08ba1a9 commit 5734b44
Show file tree
Hide file tree
Showing 5 changed files with 687 additions and 864 deletions.
5 changes: 4 additions & 1 deletion bittensor/_axon/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,9 @@ def __init__(
self.receiver_hotkey = receiver_hotkey


def parse_signature_v2(self, signature: str) -> Optional[Tuple[int, str, str, str]]:
def parse_signature_v2(
self, signature: str
) -> Union[Tuple[int, str, str, str, int], None]:
r"""Attempts to parse a signature using the v2 format"""
parts = signature.split(".")
if len(parts) != 4:
Expand All @@ -317,6 +319,7 @@ def parse_signature(self, metadata: Dict[str, str]) -> Tuple[int, str, str, str]
raise Exception("Request signature missing")
if int(version) < 370:
raise Exception("Incorrect Version")

parts = self.parse_signature_v2(signature)
if parts is not None:
return parts
Expand Down
Loading

0 comments on commit 5734b44

Please sign in to comment.