From bf5f4e547ae8e42794e9c0b98467bbd851588847 Mon Sep 17 00:00:00 2001 From: Francois Date: Thu, 26 Jun 2025 16:08:28 +0200 Subject: [PATCH] fix(pubkey-strategy): use new PrivateKeyPolicy constructors for checks --- .../lib/src/trezor/trezor_auth_service.dart | 4 ++-- .../komodo_defi_types/lib/src/public_key/pubkey_strategy.dart | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/komodo_defi_local_auth/lib/src/trezor/trezor_auth_service.dart b/packages/komodo_defi_local_auth/lib/src/trezor/trezor_auth_service.dart index e8674bae..fe8262bd 100644 --- a/packages/komodo_defi_local_auth/lib/src/trezor/trezor_auth_service.dart +++ b/packages/komodo_defi_local_auth/lib/src/trezor/trezor_auth_service.dart @@ -159,7 +159,7 @@ class TrezorAuthService implements IAuthService { required AuthOptions options, }) async { // Throw exception if PrivateKeyPolicy is NOT trezor - if (options.privKeyPolicy != PrivateKeyPolicy.trezor) { + if (options.privKeyPolicy != const PrivateKeyPolicy.trezor()) { throw AuthException( 'TrezorAuthService only supports Trezor private key policy', type: AuthExceptionType.generalAuthError, @@ -226,7 +226,7 @@ class TrezorAuthService implements IAuthService { Mnemonic? mnemonic, }) async { // Throw exception if PrivateKeyPolicy is NOT trezor - if (options.privKeyPolicy != PrivateKeyPolicy.trezor) { + if (options.privKeyPolicy != const PrivateKeyPolicy.trezor()) { throw AuthException( 'TrezorAuthService only supports Trezor private key policy', type: AuthExceptionType.generalAuthError, diff --git a/packages/komodo_defi_types/lib/src/public_key/pubkey_strategy.dart b/packages/komodo_defi_types/lib/src/public_key/pubkey_strategy.dart index 514d0fe8..74d25b25 100644 --- a/packages/komodo_defi_types/lib/src/public_key/pubkey_strategy.dart +++ b/packages/komodo_defi_types/lib/src/public_key/pubkey_strategy.dart @@ -42,9 +42,9 @@ class PubkeyStrategyFactory { final privKeyPolicy = kdfUser.walletId.authOptions.privKeyPolicy; switch (privKeyPolicy) { - case PrivateKeyPolicy.trezor: + case const PrivateKeyPolicy.trezor(): return TrezorHDWalletStrategy(kdfUser: kdfUser); - case PrivateKeyPolicy.contextPrivKey: + case const PrivateKeyPolicy.contextPrivKey(): return ContextPrivKeyHDWalletStrategy(kdfUser: kdfUser); } }