From 3803659fefc27bec6c1096e0bd4ea38075180896 Mon Sep 17 00:00:00 2001 From: Francois Date: Fri, 5 Sep 2025 08:15:36 +0200 Subject: [PATCH 1/6] chore(deps): bump flutter version to 3.35.3 --- .docker/komodo-wallet-android.dockerfile | 4 ++-- .github/actions/flutter-deps/action.yml | 2 +- .github/workflows/roll-sdk-packages.yml | 4 ++-- app_theme/pubspec.yaml | 2 +- docs/FLUTTER_VERSION.md | 6 +++--- docs/MULTIPLE_FLUTTER_VERSIONS.md | 16 ++++++++-------- packages/komodo_ui_kit/pubspec.yaml | 2 +- pubspec.lock | 2 +- pubspec.yaml | 2 +- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.docker/komodo-wallet-android.dockerfile b/.docker/komodo-wallet-android.dockerfile index f2a136c92c..d690c4cd91 100644 --- a/.docker/komodo-wallet-android.dockerfile +++ b/.docker/komodo-wallet-android.dockerfile @@ -1,6 +1,6 @@ FROM komodo/android-sdk:35 AS final -ENV FLUTTER_VERSION="3.35.2" +ENV FLUTTER_VERSION="3.35.3" ENV HOME="/home/komodo" ENV USER="komodo" ENV PATH=$PATH:$HOME/flutter/bin @@ -14,4 +14,4 @@ RUN curl -O https://storage.googleapis.com/flutter_infra_release/releases/stable rm flutter_linux_${FLUTTER_VERSION}-stable.tar.xz && \ flutter config --no-analytics && \ yes "y" | flutter doctor --android-licenses && \ - flutter doctor \ No newline at end of file + flutter doctor diff --git a/.github/actions/flutter-deps/action.yml b/.github/actions/flutter-deps/action.yml index e03ac3c2c0..34cb7741de 100644 --- a/.github/actions/flutter-deps/action.yml +++ b/.github/actions/flutter-deps/action.yml @@ -7,7 +7,7 @@ runs: uses: subosito/flutter-action@v2 with: # NB! Keep up-to-date with the flutter version used for development - flutter-version: "3.35.2" + flutter-version: "3.35.3" channel: "stable" - name: Prepare build directory diff --git a/.github/workflows/roll-sdk-packages.yml b/.github/workflows/roll-sdk-packages.yml index 910c98e824..e5ba912c43 100644 --- a/.github/workflows/roll-sdk-packages.yml +++ b/.github/workflows/roll-sdk-packages.yml @@ -46,7 +46,7 @@ jobs: uses: subosito/flutter-action@v2 with: # NB! Keep up-to-date with the flutter version used for development - flutter-version: "3.35.2" + flutter-version: "3.35.3" channel: "stable" - name: Determine configuration @@ -89,7 +89,7 @@ jobs: echo "SDK packages were successfully rolled" else echo "ROLLS_FOUND=false" >> $GITHUB_ENV - + if [ -n "${EXIT_CODE}" ] && [ ${EXIT_CODE} -ne 100 ]; then echo "::warning::SDK package roll script failed with exit code ${EXIT_CODE}" else diff --git a/app_theme/pubspec.yaml b/app_theme/pubspec.yaml index 27e1c6afc1..c4e2bd83bb 100644 --- a/app_theme/pubspec.yaml +++ b/app_theme/pubspec.yaml @@ -7,7 +7,7 @@ resolution: workspace environment: sdk: ">=3.8.1 <4.0.0" - flutter: ">=3.35.2 <4.0.0" + flutter: ">=3.35.3 <4.0.0" dependencies: flutter: diff --git a/docs/FLUTTER_VERSION.md b/docs/FLUTTER_VERSION.md index 09ded4982c..725b92df3e 100644 --- a/docs/FLUTTER_VERSION.md +++ b/docs/FLUTTER_VERSION.md @@ -2,7 +2,7 @@ ## Supported Flutter Version -This project supports Flutter `3.35.2` (latest stable release). We aim to keep the project up-to-date with the most recent stable Flutter versions. +This project supports Flutter `3.35.3` (latest stable release). We aim to keep the project up-to-date with the most recent stable Flutter versions. ## Recommended Approach: Multiple Flutter Versions @@ -15,14 +15,14 @@ See our guide on [Multiple Flutter Versions](MULTIPLE_FLUTTER_VERSIONS.md) for d While it's possible to pin your global Flutter installation to a specific version, **this approach is not recommended** due to: - Lack of isolation between projects -- Known issues with `flutter pub get` when using Flutter 3.35.2 +- Known issues with `flutter pub get` when using Flutter 3.35.3 - Difficulty switching between versions for different projects If you still choose to use this method, you can run: ```bash cd ~/flutter -git checkout 3.35.2 +git checkout 3.35.3 flutter doctor ``` diff --git a/docs/MULTIPLE_FLUTTER_VERSIONS.md b/docs/MULTIPLE_FLUTTER_VERSIONS.md index 22ecb212a3..561083386a 100644 --- a/docs/MULTIPLE_FLUTTER_VERSIONS.md +++ b/docs/MULTIPLE_FLUTTER_VERSIONS.md @@ -57,7 +57,7 @@ sudo pacman -R flutter # for Arch 2. Launch Flutter Sidekick -3. Click on "Versions" in the sidebar and download Flutter version `3.35.2` +3. Click on "Versions" in the sidebar and download Flutter version `3.35.3` 4. Set this version as the global default by clicking the "Set as Global" button @@ -92,11 +92,11 @@ sudo pacman -R flutter # for Arch curl -fsSL https://fvm.app/install.sh | bash ``` -2. Install and use Flutter 3.35.2: +2. Install and use Flutter 3.35.3: ```bash - fvm install 3.35.2 - fvm global 3.35.2 + fvm install 3.35.3 + fvm global 3.35.3 ``` 3. Add FVM's default Flutter version to your PATH by adding the following to your `~/.bashrc`, `~/.zshrc`, or equivalent: @@ -131,11 +131,11 @@ sudo pacman -R flutter # for Arch choco install fvm ``` -3. Install and use Flutter 3.35.2: +3. Install and use Flutter 3.35.3: ```powershell - fvm install 3.35.2 - fvm global 3.35.2 + fvm install 3.35.3 + fvm global 3.35.3 ``` 4. Add FVM's Flutter version to your PATH: @@ -158,7 +158,7 @@ To use a specific Flutter version for a project: 2. Run: ```bash - fvm use 3.35.2 + fvm use 3.35.3 ``` This will create a `.fvmrc` file in your project, which specifies the Flutter version to use for this project. diff --git a/packages/komodo_ui_kit/pubspec.yaml b/packages/komodo_ui_kit/pubspec.yaml index 2dc20bf43d..eca3b99ebf 100644 --- a/packages/komodo_ui_kit/pubspec.yaml +++ b/packages/komodo_ui_kit/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: none environment: sdk: ">=3.8.1 <4.0.0" - flutter: ">=3.35.2 <4.0.0" + flutter: ">=3.35.3 <4.0.0" resolution: workspace diff --git a/pubspec.lock b/pubspec.lock index 1c10fa4bc9..ca2aeb0638 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1576,4 +1576,4 @@ packages: version: "3.1.3" sdks: dart: ">=3.8.1 <4.0.0" - flutter: ">=3.35.2" + flutter: ">=3.35.3" diff --git a/pubspec.yaml b/pubspec.yaml index c2d407a111..2f25cf6556 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -19,7 +19,7 @@ version: 0.9.2+0 environment: sdk: ">=3.8.1 <4.0.0" - flutter: ">=3.35.2 <4.0.0" + flutter: ">=3.35.3 <4.0.0" workspace: - packages/komodo_ui_kit From d6021cc870adacf916ef273ae9af05b9fa937866 Mon Sep 17 00:00:00 2001 From: Francois Date: Fri, 5 Sep 2025 10:44:18 +0200 Subject: [PATCH 2/6] fix(auth): always add wallet coins on restore for legacy and seed files --- lib/bloc/auth_bloc/auth_bloc.dart | 41 +++++++++++++---------- lib/blocs/wallets_repository.dart | 54 +++++++++++++++++++------------ lib/model/wallet.dart | 30 +++++++++++++++++ 3 files changed, 87 insertions(+), 38 deletions(-) diff --git a/lib/bloc/auth_bloc/auth_bloc.dart b/lib/bloc/auth_bloc/auth_bloc.dart index 418be2f0de..a52b06a51e 100644 --- a/lib/bloc/auth_bloc/auth_bloc.dart +++ b/lib/bloc/auth_bloc/auth_bloc.dart @@ -42,6 +42,7 @@ class AuthBloc extends Bloc with TrezorAuthMixin { final WalletsRepository _walletsRepository; final SettingsRepository _settingsRepository; StreamSubscription? _authChangesSubscription; + @override final _log = Logger('AuthBloc'); @override @@ -91,11 +92,10 @@ class AuthBloc extends Bloc with TrezorAuthMixin { ); } - _log.info('login from a wallet'); emit(AuthBlocState.loading()); + _log.info('Logging in to an existing wallet.'); final weakPasswordsAllowed = await _areWeakPasswordsAllowed(); - await _kdfSdk.auth.signIn( walletName: event.wallet.name, password: event.password, @@ -111,7 +111,7 @@ class AuthBloc extends Bloc with TrezorAuthMixin { return emit(AuthBlocState.error(AuthException.notSignedIn())); } - _log.info('logged in from a wallet'); + _log.info('Successfully logged in to wallet'); emit(AuthBlocState.loggedIn(currentUser)); _listenToAuthStateChanges(); } catch (e, s) { @@ -162,10 +162,8 @@ class AuthBloc extends Bloc with TrezorAuthMixin { return; } - _log.info('register from a wallet'); - + _log.info('Registering a new wallet'); final weakPasswordsAllowed = await _areWeakPasswordsAllowed(); - await _kdfSdk.auth.register( password: event.password, walletName: event.wallet.name, @@ -177,7 +175,9 @@ class AuthBloc extends Bloc with TrezorAuthMixin { ), ); - _log.info('registered from a wallet'); + _log.info( + 'Registered a new wallet, setting up metadata and logging in...', + ); await _kdfSdk.setWalletType(event.wallet.config.type); await _kdfSdk.confirmSeedBackup(hasBackup: false); await _kdfSdk.addActivatedCoins(enabledByDefaultCoins); @@ -210,10 +210,8 @@ class AuthBloc extends Bloc with TrezorAuthMixin { return; } - _log.info('restore from a wallet'); - + _log.info('Restoring wallet from a seed'); final weakPasswordsAllowed = await _areWeakPasswordsAllowed(); - await _kdfSdk.auth.register( password: event.password, walletName: event.wallet.name, @@ -226,27 +224,36 @@ class AuthBloc extends Bloc with TrezorAuthMixin { ), ); - _log.info('restored from a wallet'); + _log.info( + 'Successfully restored wallet from a seed. ' + 'Setting up wallet metadata and logging in...', + ); await _kdfSdk.setWalletType(event.wallet.config.type); await _kdfSdk.confirmSeedBackup(hasBackup: event.wallet.config.hasBackup); await _kdfSdk.addActivatedCoins(enabledByDefaultCoins); - - final currentUser = await _kdfSdk.auth.currentUser; - if (currentUser == null) { - throw Exception('Registration failed: user is not signed in'); + if (event.wallet.config.activatedCoins.isNotEmpty) { + await _kdfSdk.addActivatedCoins(event.wallet.config.activatedCoins); } - emit(AuthBlocState.loggedIn(currentUser)); // Delete legacy wallet on successful restoration & login to avoid // duplicates in the wallet list if (event.wallet.isLegacyWallet) { - await _kdfSdk.addActivatedCoins(event.wallet.config.activatedCoins); + _log.info( + 'Migration successful. ' + 'Deleting legacy wallet ${event.wallet.name}', + ); await _walletsRepository.deleteWallet( event.wallet, password: event.password, ); } + final currentUser = await _kdfSdk.auth.currentUser; + if (currentUser == null) { + throw Exception('Restoration from seed failed: user is not signed in'); + } + + emit(AuthBlocState.loggedIn(currentUser)); _listenToAuthStateChanges(); } catch (e, s) { final errorMsg = 'Failed to restore existing wallet ${event.wallet.name}'; diff --git a/lib/blocs/wallets_repository.dart b/lib/blocs/wallets_repository.dart index eb449ddc1b..0dba0dba1f 100644 --- a/lib/blocs/wallets_repository.dart +++ b/lib/blocs/wallets_repository.dart @@ -20,8 +20,8 @@ class WalletsRepository { this._legacyWalletStorage, { EncryptionTool? encryptionTool, FileLoader? fileLoader, - }) : _encryptionTool = encryptionTool ?? EncryptionTool(), - _fileLoader = fileLoader ?? FileLoader.fromPlatform(); + }) : _encryptionTool = encryptionTool ?? EncryptionTool(), + _fileLoader = fileLoader ?? FileLoader.fromPlatform(); final KomodoDefiSdk _kdfSdk; final Mm2Api _mm2Api; @@ -34,9 +34,10 @@ class WalletsRepository { Future> getWallets() async { final legacyWallets = await _getLegacyWallets(); + final sdkWallets = await _kdfSdk.wallets; // TODO: move wallet filtering logic to the SDK - _cachedWallets = (await _kdfSdk.wallets) + _cachedWallets = sdkWallets .where( (wallet) => wallet.config.type != WalletType.trezor && @@ -52,16 +53,22 @@ class WalletsRepository { final List> json = newVariable?.cast>() ?? >[]; - return json - .map((Map w) => - Wallet.fromJson(w)..config.isLegacyWallet = true) - .toList(); + return json.map((Map w) { + final wallet = Wallet.fromJson(w); + return wallet.copyWith( + config: wallet.config.copyWith( + // Intentionally set the wallet type to hdwallet when migrating from + // legacy to SDK-managed wallets. This ensures that legacy wallets + // are treated as HD wallets in the app, now that the HD toggle is + // hidden for iguana wallets. + type: WalletType.hdwallet, + isLegacyWallet: true, + ), + ); + }).toList(); } - Future deleteWallet( - Wallet wallet, { - required String password, - }) async { + Future deleteWallet(Wallet wallet, {required String password}) async { log( 'Deleting a wallet ${wallet.id}', path: 'wallet_bloc => deleteWallet', @@ -82,9 +89,11 @@ class WalletsRepository { _cachedWallets?.removeWhere((w) => w.name == wallet.name); return; } catch (e) { - log('Failed to delete wallet: $e', - path: 'wallet_bloc => deleteWallet', isError: true) - .ignore(); + log( + 'Failed to delete wallet: $e', + path: 'wallet_bloc => deleteWallet', + isError: true, + ).ignore(); rethrow; } } @@ -99,14 +108,14 @@ class WalletsRepository { getWallets().ignore(); return null; } - + final trimmedName = name.trim(); - + // Check if the trimmed name is empty (prevents space-only names) if (trimmedName.isEmpty) { return LocaleKeys.walletCreationNameLengthError.tr(); } - + // Check if trimmed name exceeds length limit if (trimmedName.length > 40) { return LocaleKeys.walletCreationNameLengthError.tr(); @@ -122,8 +131,9 @@ class WalletsRepository { } Future resetSpecificWallet(Wallet wallet) async { - final coinsToDeactivate = wallet.config.activatedCoins - .where((coin) => !enabledByDefaultCoins.contains(coin)); + final coinsToDeactivate = wallet.config.activatedCoins.where( + (coin) => !enabledByDefaultCoins.contains(coin), + ); for (final coin in coinsToDeactivate) { await _mm2Api.disableCoin(coin); } @@ -140,8 +150,10 @@ class WalletsRepository { ); } final String data = jsonEncode(wallet.config); - final String encryptedData = - await _encryptionTool.encryptData(password, data); + final String encryptedData = await _encryptionTool.encryptData( + password, + data, + ); final String sanitizedFileName = _sanitizeFileName(wallet.name); await _fileLoader.save( fileName: sanitizedFileName, diff --git a/lib/model/wallet.dart b/lib/model/wallet.dart index 2a18f8637f..518d4c4317 100644 --- a/lib/model/wallet.dart +++ b/lib/model/wallet.dart @@ -79,6 +79,18 @@ class Wallet { config: config.copy(), ); } + + Wallet copyWith({ + String? id, + String? name, + WalletConfig? config, + }) { + return Wallet( + id: id ?? this.id, + name: name ?? this.name, + config: config ?? this.config.copy(), + ); + } } class WalletConfig { @@ -131,6 +143,24 @@ class WalletConfig { pubKey: pubKey, ); } + + WalletConfig copyWith({ + String? seedPhrase, + String? pubKey, + List? activatedCoins, + bool? hasBackup, + WalletType? type, + bool? isLegacyWallet, + }) { + return WalletConfig( + seedPhrase: seedPhrase ?? this.seedPhrase, + pubKey: pubKey ?? this.pubKey, + activatedCoins: activatedCoins ?? [...this.activatedCoins], + hasBackup: hasBackup ?? this.hasBackup, + type: type ?? this.type, + isLegacyWallet: isLegacyWallet ?? this.isLegacyWallet, + ); + } } enum WalletType { From 8d790510fdb21653cf93ef2ba08e3590805f7ad0 Mon Sep 17 00:00:00 2001 From: Francois Date: Mon, 8 Sep 2025 21:43:35 +0200 Subject: [PATCH 3/6] refactor(auth): default legacy back to iguana and clean up onrestore --- lib/bloc/auth_bloc/auth_bloc.dart | 10 +++++++--- lib/blocs/wallets_repository.dart | 19 +++++++++---------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/lib/bloc/auth_bloc/auth_bloc.dart b/lib/bloc/auth_bloc/auth_bloc.dart index a52b06a51e..6bf1102af9 100644 --- a/lib/bloc/auth_bloc/auth_bloc.dart +++ b/lib/bloc/auth_bloc/auth_bloc.dart @@ -205,11 +205,17 @@ class AuthBloc extends Bloc with TrezorAuthMixin { Emitter emit, ) async { try { - emit(AuthBlocState.loading()); if (await _didSignInExistingWallet(event.wallet, event.password)) { + add( + AuthSignInRequested(wallet: event.wallet, password: event.password), + ); + _log.warning( + 'Wallet ${event.wallet.name} already exist, attempting sign-in', + ); return; } + emit(AuthBlocState.loading()); _log.info('Restoring wallet from a seed'); final weakPasswordsAllowed = await _areWeakPasswordsAllowed(); await _kdfSdk.auth.register( @@ -273,8 +279,6 @@ class AuthBloc extends Bloc with TrezorAuthMixin { (KdfUser user) => user.walletId.name == wallet.name, ); if (walletExists) { - add(AuthSignInRequested(wallet: wallet, password: password)); - _log.warning('Wallet ${wallet.name} already exist, attempting sign-in'); return true; } diff --git a/lib/blocs/wallets_repository.dart b/lib/blocs/wallets_repository.dart index 0dba0dba1f..693f2a4860 100644 --- a/lib/blocs/wallets_repository.dart +++ b/lib/blocs/wallets_repository.dart @@ -48,20 +48,19 @@ class WalletsRepository { } Future> _getLegacyWallets() async { - final newVariable = - await _legacyWalletStorage.read(allWalletsStorageKey) as List?; - final List> json = - newVariable?.cast>() ?? >[]; + final rawLegacyWallets = + (await _legacyWalletStorage.read(allWalletsStorageKey) as List?) + ?.cast>() ?? + []; - return json.map((Map w) { + return rawLegacyWallets.map((Map w) { final wallet = Wallet.fromJson(w); return wallet.copyWith( config: wallet.config.copyWith( - // Intentionally set the wallet type to hdwallet when migrating from - // legacy to SDK-managed wallets. This ensures that legacy wallets - // are treated as HD wallets in the app, now that the HD toggle is - // hidden for iguana wallets. - type: WalletType.hdwallet, + // Wallet type for legacy wallets is iguana, to avoid confusion with + // missing/empty balances. Sign into iguana for legacy wallets by + // default, but allow for them to be signed into hdwallet if desired. + type: WalletType.iguana, isLegacyWallet: true, ), ); From f41d940878444deb82ab3fb73ac96aa569842eeb Mon Sep 17 00:00:00 2001 From: Francois Date: Tue, 2 Sep 2025 16:00:32 +0200 Subject: [PATCH 4/6] chore(deps): bump sdk to 3f503d2 and fix breaking sparkline change --- lib/main.dart | 7 +++--- .../initializer/app_bootstrapper.dart | 23 +++++++++++++------ sdk | 2 +- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index d103a0bab8..682d817040 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -59,7 +59,10 @@ Future main() async { // is the only/primary API/repository for KDF final KomodoDefiSdk komodoDefiSdk = await mm2.initialize(); final mm2Api = Mm2Api(mm2: mm2, sdk: komodoDefiSdk); - await AppBootstrapper.instance.ensureInitialized(komodoDefiSdk, mm2Api); + // Sparkline is dependent on Hive initialization, so we pass it on to the + // bootstrapper here + final sparklineRepository = SparklineRepository.defaultInstance(); + await AppBootstrapper.instance.ensureInitialized(komodoDefiSdk, mm2Api, sparklineRepository); final coinsRepo = CoinsRepo(kdfSdk: komodoDefiSdk, mm2: mm2); final walletsRepository = WalletsRepository( @@ -81,8 +84,6 @@ Future main() async { RepositoryProvider(create: (_) => mm2Api), RepositoryProvider(create: (_) => coinsRepo), RepositoryProvider(create: (_) => walletsRepository), - // TODO: Refactor in SDK to avoid use of this global variable. - // This is necessary for now for CoinSparkline. RepositoryProvider(create: (_) => sparklineRepository), ], child: const MyApp(), diff --git a/lib/services/initializer/app_bootstrapper.dart b/lib/services/initializer/app_bootstrapper.dart index 1d79aa6c27..b1a5e13453 100644 --- a/lib/services/initializer/app_bootstrapper.dart +++ b/lib/services/initializer/app_bootstrapper.dart @@ -9,7 +9,11 @@ final class AppBootstrapper { bool _isInitialized = false; - Future ensureInitialized(KomodoDefiSdk kdfSdk, Mm2Api mm2Api) async { + Future ensureInitialized( + KomodoDefiSdk kdfSdk, + Mm2Api mm2Api, + SparklineRepository sparklineRepository, + ) async { if (_isInitialized) return; // Register core services with GetIt @@ -22,8 +26,10 @@ final class AppBootstrapper { log('AppBootstrapper: Log initialized in ${timer.elapsedMilliseconds}ms'); timer.reset(); - await _warmUpInitializers().awaitAll(); - log('AppBootstrapper: Warm-up initializers completed in ${timer.elapsedMilliseconds}ms'); + await _warmUpInitializers(sparklineRepository).awaitAll(); + log( + 'AppBootstrapper: Warm-up initializers completed in ${timer.elapsedMilliseconds}ms', + ); timer.stop(); _isInitialized = true; @@ -38,7 +44,9 @@ final class AppBootstrapper { /// A list of futures that should be completed before the app starts /// ([runApp]) which do not depend on each other. - List> _warmUpInitializers() { + List> _warmUpInitializers( + SparklineRepository sparklineRepository, + ) { return [ app_bloc_root.loadLibrary(), packageInformation.init(), @@ -46,9 +54,10 @@ final class AppBootstrapper { CexMarketData.ensureInitialized(), PlatformTuner.setWindowTitleAndSize(), _initializeSettings(), - _initHive(isWeb: kIsWeb || kIsWasm, appFolder: appFolder).then( - (_) => sparklineRepository.init(), - ), + _initHive( + isWeb: kIsWeb || kIsWasm, + appFolder: appFolder, + ).then((_) => sparklineRepository.init()), ]; } diff --git a/sdk b/sdk index f22ca69547..3f503d2368 160000 --- a/sdk +++ b/sdk @@ -1 +1 @@ -Subproject commit f22ca695471a52f3409726d01116fc811cee6751 +Subproject commit 3f503d2368c6ddd7a03bb15b587c3f27efa845c5 From bb8bf90546ffe4c0299252943d4d81a0a27f2112 Mon Sep 17 00:00:00 2001 From: Francois Date: Mon, 8 Sep 2025 21:46:29 +0200 Subject: [PATCH 5/6] chore(sdk): update to bip39 compatibility fix 508d63f --- sdk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk b/sdk index 3f503d2368..508d63f733 160000 --- a/sdk +++ b/sdk @@ -1 +1 @@ -Subproject commit 3f503d2368c6ddd7a03bb15b587c3f27efa845c5 +Subproject commit 508d63f733e544dec897ae3a18da4393b04365e7 From fb2b9136c077e2e835a8934effc27f75547001b3 Mon Sep 17 00:00:00 2001 From: Francois Date: Tue, 9 Sep 2025 11:55:21 +0200 Subject: [PATCH 6/6] fix(auth): noSuchMethod on Decimal and sign in existing --- lib/bloc/auth_bloc/auth_bloc.dart | 8 +++++++- .../wallet_page/common/grouped_asset_ticker_item.dart | 7 +++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/bloc/auth_bloc/auth_bloc.dart b/lib/bloc/auth_bloc/auth_bloc.dart index 6bf1102af9..cdcb58f346 100644 --- a/lib/bloc/auth_bloc/auth_bloc.dart +++ b/lib/bloc/auth_bloc/auth_bloc.dart @@ -159,6 +159,12 @@ class AuthBloc extends Bloc with TrezorAuthMixin { try { emit(AuthBlocState.loading()); if (await _didSignInExistingWallet(event.wallet, event.password)) { + add( + AuthSignInRequested(wallet: event.wallet, password: event.password), + ); + _log.warning( + 'Wallet ${event.wallet.name} already exists, attempting sign-in', + ); return; } @@ -210,7 +216,7 @@ class AuthBloc extends Bloc with TrezorAuthMixin { AuthSignInRequested(wallet: event.wallet, password: event.password), ); _log.warning( - 'Wallet ${event.wallet.name} already exist, attempting sign-in', + 'Wallet ${event.wallet.name} already exists, attempting sign-in', ); return; } diff --git a/lib/views/wallet/wallet_page/common/grouped_asset_ticker_item.dart b/lib/views/wallet/wallet_page/common/grouped_asset_ticker_item.dart index f2383fc91b..15ff7ef7de 100644 --- a/lib/views/wallet/wallet_page/common/grouped_asset_ticker_item.dart +++ b/lib/views/wallet/wallet_page/common/grouped_asset_ticker_item.dart @@ -122,8 +122,11 @@ class _GroupedAssetTickerItemState extends State { flex: 2, child: BlocBuilder( builder: (context, state) { - final formattedPrice = price?.price != null - ? priceFormatter.format(price!.price) + // Double conversion required to fix the + // `noSuchMethod` error in the `format` method. + final priceValue = price?.price?.toDouble(); + final formattedPrice = priceValue != null + ? priceFormatter.format(priceValue) : ''; return Text( formattedPrice,