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 3c85029 commit 21e7441
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions aptos_sdk/asymmetric_crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
# SPDX-License-Identifier: Apache-2.0

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 +27,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 +47,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 21e7441

Please sign in to comment.