From 21e7441299632ee8d7456eb39b46dbd5419a47d1 Mon Sep 17 00:00:00 2001 From: Philip Vu Date: Mon, 28 Oct 2024 16:12:44 -0700 Subject: [PATCH] Fix lint --- aptos_sdk/asymmetric_crypto.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/aptos_sdk/asymmetric_crypto.py b/aptos_sdk/asymmetric_crypto.py index 0761490..6d6dc74 100644 --- a/aptos_sdk/asymmetric_crypto.py +++ b/aptos_sdk/asymmetric_crypto.py @@ -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" @@ -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-", } @@ -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):