Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
GhostWalker562 committed Oct 28, 2024
1 parent d35f86d commit d6fc463
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions aptos_sdk/asymmetric_crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@

from __future__ import annotations

from enum import Enum

from typing_extensions import Protocol

from .bcs import Deserializable, Serializable


class PrivateKeyVariant:
class PrivateKeyVariant(Enum):
Ed25519 = "ed25519"
Secp256k1 = "secp256k1"

Expand All @@ -26,7 +28,7 @@ def sign(self, data: bytes) -> Signature: ...
[Read about AIP-80](https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-80.md)
"""
AIP80_PREFIXES = {
AIP80_PREFIXES: dict[PrivateKeyVariant, str] = {
PrivateKeyVariant.Ed25519: "ed25519-priv-",
PrivateKeyVariant.Secp256k1: "secp256k1-priv-",
}
Expand All @@ -46,7 +48,7 @@ def format_private_key(
raise ValueError(f"Unknown private key type: {key_type}")
aip80_prefix = PrivateKey.AIP80_PREFIXES[key_type]

key_value: str = None
key_value: str | None = None
if isinstance(private_key, str):
key_value = private_key
elif isinstance(private_key, bytes):
Expand Down

0 comments on commit d6fc463

Please sign in to comment.