Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.7 version checking #1195

Merged
merged 14 commits into from
Mar 21, 2023
4 changes: 4 additions & 0 deletions bittensor/_axon/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,12 @@ def parse_signature(
) -> Tuple[int, str, str, str, int]:
r"""Attempts to parse a signature from the metadata"""
signature = metadata.get("bittensor-signature")
version = metadata.get('bittensor-version')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metadata is a Dict[str, str]. You need to cast to integer if you want to compare it with an integer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Adrian!

if signature is None:
raise Exception("Request signature missing")
if version < 370:
raise Exception("Incorrect Version")

for parser in [self.parse_signature_v2, self.parse_legacy_signature]:
parts = parser(signature)
if parts is not None:
Expand Down