diff --git a/core/src/apps/solana/__init__.py b/core/src/apps/solana/__init__.py index 6ad004f646..e17d7b9939 100644 --- a/core/src/apps/solana/__init__.py +++ b/core/src/apps/solana/__init__.py @@ -1,4 +1,8 @@ CURVE = "ed25519" SLIP44_ID = 501 # TODO SOL: other patterns? -PATTERN = "m/44'/coin_type'/account'/address_index'" +PATTERNS = ( + "m/44'/coin_type'", # Ledger compatibility + "m/44'/coin_type'/account'", # Ledger compatibility + "m/44'/coin_type'/account'/address_index'" +) diff --git a/core/src/apps/solana/get_address.py b/core/src/apps/solana/get_address.py index 31bf3465bc..1a225cca55 100644 --- a/core/src/apps/solana/get_address.py +++ b/core/src/apps/solana/get_address.py @@ -1,8 +1,9 @@ from typing import TYPE_CHECKING from trezor.crypto import base58 +from apps.common.keychain import with_slip44_keychain -from apps.common.keychain import auto_keychain +from . import CURVE, PATTERNS, SLIP44_ID if TYPE_CHECKING: from trezor.messages import SolanaGetAddress, SolanaAddress @@ -10,7 +11,7 @@ if TYPE_CHECKING: from apps.common.keychain import Keychain -@auto_keychain(__name__) +@with_slip44_keychain(*PATTERNS, slip44_id=SLIP44_ID, curve=CURVE) async def get_address( msg: SolanaGetAddress, keychain: Keychain, diff --git a/core/src/apps/solana/get_public_key.py b/core/src/apps/solana/get_public_key.py index efc1978733..94699cdd08 100644 --- a/core/src/apps/solana/get_public_key.py +++ b/core/src/apps/solana/get_public_key.py @@ -2,7 +2,9 @@ from typing import TYPE_CHECKING from ubinascii import hexlify from apps.common import seed -from apps.common.keychain import auto_keychain +from apps.common.keychain import with_slip44_keychain + +from . import CURVE, PATTERNS, SLIP44_ID if TYPE_CHECKING: from trezor.messages import SolanaGetPublicKey, SolanaPublicKey @@ -10,7 +12,7 @@ if TYPE_CHECKING: # TODO SOL: maybe only get_address is needed? -@auto_keychain(__name__) +@with_slip44_keychain(*PATTERNS, slip44_id=SLIP44_ID, curve=CURVE) async def get_public_key( msg: SolanaGetPublicKey, keychain: Keychain ) -> SolanaPublicKey: