-
Notifications
You must be signed in to change notification settings - Fork 230
feat(trezor): migration to SDK with up-to-date RPCs #2836
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
TODO: fix auto coin activation and UTXO only coin filter
fixes crash if transaction is send to oneself
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThis update removes all legacy Trezor hardware wallet integration code, including related blocs, repositories, models, and API layers. Trezor authentication and wallet operations are now handled via a new Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant UI
participant AuthBloc
participant KomodoDefiSdk
User->>UI: Selects Trezor wallet
UI->>AuthBloc: Dispatch AuthTrezorInitAndAuthStarted
AuthBloc->>KomodoDefiSdk: Start Trezor auth stream
KomodoDefiSdk-->>AuthBloc: Emits AuthenticationState (various statuses)
AuthBloc->>UI: Emits AuthBlocState (e.g., initializing, pin/passphrase required)
User->>UI: Enters PIN/Passphrase
UI->>AuthBloc: Dispatch AuthTrezorPinProvided/AuthTrezorPassphraseProvided
AuthBloc->>KomodoDefiSdk: Provide credentials
KomodoDefiSdk-->>AuthBloc: Emits AuthenticationState.completed
AuthBloc->>UI: Emits logged-in state
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Visit the preview URL for this PR (updated for commit f176228): https://walletrc--pull-2836-merge-tyk9ck28.web.app (expires Mon, 14 Jul 2025 14:13:46 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: f66a4ff03faa546f12f0ae5a841bd9eff2714dcc |
fixes issue where "Add Assets" list is empty until at least 1 coin is activated.
fixes asset not found exception when signing out of trezor wallet with filtered assets (utxo only) - eth not found
coin filtering based on wallet type now happens in the SDK, so additional checks can slowly be removed from KW
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🔭 Outside diff range comments (6)
lib/bloc/auth_bloc/auth_bloc.dart (1)
288-288
: Address deprecated method usageThe pipeline indicates that
downloadEncryptedWallet
is deprecated and should be replaced withKomodoDefiSdk.auth.getMnemonicEncrypted
.Apply this fix to use the recommended replacement:
- await _walletsRepository.downloadEncryptedWallet(wallet, event.password); + await _kdfSdk.auth.getMnemonicEncrypted(event.password);lib/bloc/coins_bloc/coins_repo.dart (4)
395-404
: Consider removing deprecatedgetFirstPubkey
methodThis method is marked as deprecated with clear guidance to use
_kdfSdk.pubkeys.getPubkeys
instead. Since it's still being used internally (lines 203, 232, 398), consider refactoring these usages to use the SDK directly and let users select from available pubkeys as suggested in the deprecation notice.
386-393
: Replace deprecated MM2call
methodThe
_mm2.call()
method is deprecated. Replace with SDK'sclient.rpc
orclient.executeRpc
:
- Line 388: For disabling coins
- Line 616: For withdraw operations
Consider using the SDK's RPC client instead:
- await _mm2.call(DisableCoinReq(coin: coinId)); + await _kdfSdk.client.executeRpc(DisableCoinReq(coin: coinId));Also applies to: 614-642
406-415
: Replace deprecatedusdPrice
field accessThe
coin?.usdPrice?.price
access pattern is deprecated. Use the SDK's price manager instead:double? getUsdPriceByAmount(String amount, String coinAbbr) { final Coin? coin = getCoin(coinAbbr); final double? parsedAmount = double.tryParse(amount); - final double? usdPrice = coin?.usdPrice?.price; + final double? usdPrice = await _kdfSdk.marketData.maybeFiatPrice(coin.id)?.toDouble(); - if (coin == null || usdPrice == null || parsedAmount == null) { + if (coin == null || parsedAmount == null) { return null; } + + final fiatPrice = await _kdfSdk.marketData.maybeFiatPrice(coin.id); + if (fiatPrice == null) return null; + - return parsedAmount * usdPrice; + return parsedAmount * fiatPrice.toDouble(); }Note: This would require making the method async.
199-209
: Replace deprecated getCoin with getCoinFromId and migrate to AssetIdTo align with the SDK and remove the @deprecated API, replace all
coinsRepository.getCoin(String coinId)
calls with
coinsRepository.getCoinFromId(AssetId coinId)
(or accept AssetId directly).Key locations:
- lib/bloc/coins_bloc/coins_repo.dart (lines 199, 407, 547)
- All other occurrences found via
rg -A2 "getCoin\(" --type dart
Example refactor in coins_repo.dart:
- final coin = getCoin(enabledAsset); + // Wrap the string ID into an AssetId (use real name from your asset metadata) + final assetId = AssetId(id: enabledAsset, name: enabledAsset); + final coin = getCoinFromId(assetId); if (coin == null) return null;For a more thorough migration, consider changing method signatures to take
AssetId
instead ofString
:- Future<Coin?> fetchCoin(String enabledAsset) async { + Future<Coin?> fetchCoin(AssetId enabledAsset) async { final coin = getCoinFromId(enabledAsset); if (coin == null) return null; … }Repeat this pattern for each
getCoin(...)
usage to eliminate the deprecated API.lib/bloc/coins_bloc/coins_bloc.dart (1)
343-357
: Remove deprecatedenabledType
andreset()
usages across the codebaseThe pipeline warnings for these deprecated APIs must be addressed before the next release. We found multiple occurrences that need migration to the SDK’s recommended WalletManager and Asset state management:
• lib/shared/utils/utils.dart –
if (coin.enabledType == WalletType.trezor)
• lib/model/coin.dart – builder assignment..enabledType = …
• lib/bloc/bridge_form/bridge_validator.dart – several null checks onenabledType
• lib/bloc/taker_form/taker_validator.dart – several null checks onenabledType
• lib/bloc/coins_bloc/coins_repo.dart –coin.enabledType = currentUser.wallet.config.type
• lib/bloc/coins_bloc/coins_bloc.dart
–switch (coin.enabledType)
cases
– finalcoin.reset()
call at the end of the handlerPlease replace all
.enabledType
references with the new WalletManager APIs and swap outcoin.reset()
for the Asset state–based reset method. A global search-and-replace or codemod is recommended to ensure no occurrences are missed.
🧹 Nitpick comments (3)
lib/views/wallet/wallet_page/charts/coin_prices_chart.dart (2)
6-6
: Remove unused import.The pipeline correctly identifies this as an unused import that should be removed.
-import 'package:komodo_defi_sdk/komodo_defi_sdk.dart';
14-14
: Remove unused import.The pipeline correctly identifies this as an unused import that should be removed.
-import 'package:web_dex/bloc/coins_blob/asset_coin_extension.dart';
lib/views/common/hw_wallet_dialog/trezor_steps/trezor_dialog_error.dart (1)
24-28
: Consider preserving error-specific messagingThe simplified error display always shows
trezorErrorBusy
regardless of the actual error. This might provide less helpful feedback to users compared to the previous implementation that showed error-specific messages.Consider using the error string to provide more specific messages:
ErrorDisplay( - message: LocaleKeys.trezorErrorBusy.tr(), + message: _getErrorMessage(error), detailedMessage: error, showIcon: false, ),Add a method to map common error strings to user-friendly messages while falling back to a generic message for unknown errors.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
packages/komodo_ui_kit/pubspec.lock
is excluded by!**/*.lock
pubspec.lock
is excluded by!**/*.lock
📒 Files selected for processing (74)
assets/translations/en.json
(1 hunks)lib/app_config/app_config.dart
(0 hunks)lib/bloc/app_bloc_root.dart
(0 hunks)lib/bloc/auth_bloc/auth_bloc.dart
(4 hunks)lib/bloc/auth_bloc/auth_bloc_event.dart
(1 hunks)lib/bloc/auth_bloc/auth_bloc_state.dart
(1 hunks)lib/bloc/auth_bloc/trezor_auth_mixin.dart
(1 hunks)lib/bloc/cex_market_data/price_chart/price_chart_bloc.dart
(4 hunks)lib/bloc/cex_market_data/price_chart/price_chart_state.dart
(3 hunks)lib/bloc/coin_addresses/bloc/coin_addresses_bloc.dart
(0 hunks)lib/bloc/coins_bloc/coins_bloc.dart
(4 hunks)lib/bloc/coins_bloc/coins_repo.dart
(2 hunks)lib/bloc/coins_manager/coins_manager_bloc.dart
(1 hunks)lib/bloc/trezor_bloc/trezor_repo.dart
(0 hunks)lib/bloc/trezor_connection_bloc/trezor_connection_bloc.dart
(0 hunks)lib/bloc/trezor_connection_bloc/trezor_connection_event.dart
(0 hunks)lib/bloc/trezor_connection_bloc/trezor_connection_state.dart
(0 hunks)lib/bloc/trezor_init_bloc/trezor_init_bloc.dart
(0 hunks)lib/bloc/trezor_init_bloc/trezor_init_event.dart
(0 hunks)lib/bloc/trezor_init_bloc/trezor_init_state.dart
(0 hunks)lib/blocs/trezor_coins_bloc.dart
(0 hunks)lib/main.dart
(1 hunks)lib/mm2/mm2_api/mm2_api.dart
(0 hunks)lib/mm2/mm2_api/mm2_api_trezor.dart
(0 hunks)lib/mm2/mm2_api/rpc/trezor/balance/trezor_balance_init/trezor_balance_init_request.dart
(0 hunks)lib/mm2/mm2_api/rpc/trezor/balance/trezor_balance_init/trezor_balance_init_response.dart
(0 hunks)lib/mm2/mm2_api/rpc/trezor/balance/trezor_balance_status/trezor_balance_status_request.dart
(0 hunks)lib/mm2/mm2_api/rpc/trezor/balance/trezor_balance_status/trezor_balance_status_response.dart
(0 hunks)lib/mm2/mm2_api/rpc/trezor/enable_utxo/trezor_enable_utxo/trezor_enable_utxo_request.dart
(0 hunks)lib/mm2/mm2_api/rpc/trezor/enable_utxo/trezor_enable_utxo/trezor_enable_utxo_response.dart
(0 hunks)lib/mm2/mm2_api/rpc/trezor/enable_utxo/trezor_enable_utxo_status/trezor_enable_utxo_status_request.dart
(0 hunks)lib/mm2/mm2_api/rpc/trezor/enable_utxo/trezor_enable_utxo_status/trezor_enable_utxo_status_response.dart
(0 hunks)lib/mm2/mm2_api/rpc/trezor/get_new_address/get_new_address_request.dart
(0 hunks)lib/mm2/mm2_api/rpc/trezor/get_new_address/get_new_address_response.dart
(0 hunks)lib/mm2/mm2_api/rpc/trezor/init/init_trezor/init_trezor_request.dart
(0 hunks)lib/mm2/mm2_api/rpc/trezor/init/init_trezor/init_trezor_response.dart
(0 hunks)lib/mm2/mm2_api/rpc/trezor/init/init_trezor_cancel/init_trezor_cancel_request.dart
(0 hunks)lib/mm2/mm2_api/rpc/trezor/init/init_trezor_status/init_trezor_status_request.dart
(0 hunks)lib/mm2/mm2_api/rpc/trezor/init/init_trezor_status/init_trezor_status_response.dart
(0 hunks)lib/mm2/mm2_api/rpc/trezor/trezor_connection_status/trezor_connection_status_request.dart
(0 hunks)lib/mm2/mm2_api/rpc/trezor/trezor_passphrase/trezor_passphrase_request.dart
(0 hunks)lib/mm2/mm2_api/rpc/trezor/trezor_pin/trezor_pin_request.dart
(0 hunks)lib/mm2/mm2_api/rpc/trezor/withdraw/trezor_withdraw/trezor_withdraw_request.dart
(0 hunks)lib/mm2/mm2_api/rpc/trezor/withdraw/trezor_withdraw/trezor_withdraw_response.dart
(0 hunks)lib/mm2/mm2_api/rpc/trezor/withdraw/trezor_withdraw_cancel/trezor_withdraw_cancel_request.dart
(0 hunks)lib/mm2/mm2_api/rpc/trezor/withdraw/trezor_withdraw_status/trezor_withdraw_status_request.dart
(0 hunks)lib/mm2/mm2_api/rpc/trezor/withdraw/trezor_withdraw_status/trezor_withdraw_status_response.dart
(0 hunks)lib/model/coin.dart
(0 hunks)lib/model/hw_wallet/init_trezor.dart
(0 hunks)lib/model/hw_wallet/trezor_progress_status.dart
(0 hunks)lib/model/hw_wallet/trezor_status.dart
(0 hunks)lib/model/main_menu_value.dart
(0 hunks)lib/model/wallet.dart
(1 hunks)lib/router/navigators/page_content/page_content_router_delegate.dart
(0 hunks)lib/router/parsers/root_route_parser.dart
(0 hunks)lib/shared/utils/extensions/transaction_extensions.dart
(1 hunks)lib/views/common/hw_wallet_dialog/hw_dialog_init.dart
(2 hunks)lib/views/common/hw_wallet_dialog/hw_dialog_wallet_select.dart
(2 hunks)lib/views/common/hw_wallet_dialog/show_trezor_passphrase_dialog.dart
(2 hunks)lib/views/common/hw_wallet_dialog/show_trezor_pin_dialog.dart
(2 hunks)lib/views/common/hw_wallet_dialog/trezor_steps/trezor_dialog_error.dart
(2 hunks)lib/views/common/hw_wallet_dialog/trezor_steps/trezor_dialog_in_progress.dart
(3 hunks)lib/views/settings/widgets/security_settings/seed_settings/seed_confirmation/seed_confirmation.dart
(0 hunks)lib/views/settings/widgets/security_settings/seed_settings/seed_show.dart
(0 hunks)lib/views/wallet/coin_details/coin_details_info/charts/animated_portfolio_charts.dart
(0 hunks)lib/views/wallet/coin_details/receive/receive_address.dart
(0 hunks)lib/views/wallet/coin_details/receive/receive_address_trezor.dart
(0 hunks)lib/views/wallet/coin_details/receive/request_address_button.dart
(0 hunks)lib/views/wallet/coin_details/transactions/transaction_list_item.dart
(1 hunks)lib/views/wallet/coins_manager/coins_manager_filters_dropdown.dart
(1 hunks)lib/views/wallet/wallet_page/charts/coin_prices_chart.dart
(1 hunks)lib/views/wallets_manager/widgets/hardware_wallets_manager.dart
(3 hunks)lib/views/wallets_manager/widgets/iguana_wallets_manager.dart
(0 hunks)test_units/tests/utils/transaction_history/sanitize_transaction_test.dart
(2 hunks)
💤 Files with no reviewable changes (50)
- lib/views/wallet/coin_details/coin_details_info/charts/animated_portfolio_charts.dart
- lib/router/navigators/page_content/page_content_router_delegate.dart
- lib/views/settings/widgets/security_settings/seed_settings/seed_confirmation/seed_confirmation.dart
- lib/bloc/coin_addresses/bloc/coin_addresses_bloc.dart
- lib/views/wallets_manager/widgets/iguana_wallets_manager.dart
- lib/router/parsers/root_route_parser.dart
- lib/views/settings/widgets/security_settings/seed_settings/seed_show.dart
- lib/model/main_menu_value.dart
- lib/model/coin.dart
- lib/app_config/app_config.dart
- lib/views/wallet/coin_details/receive/receive_address.dart
- lib/bloc/trezor_connection_bloc/trezor_connection_event.dart
- lib/mm2/mm2_api/rpc/trezor/init/init_trezor/init_trezor_response.dart
- lib/mm2/mm2_api/rpc/trezor/balance/trezor_balance_init/trezor_balance_init_request.dart
- lib/mm2/mm2_api/rpc/trezor/trezor_passphrase/trezor_passphrase_request.dart
- lib/mm2/mm2_api/rpc/trezor/withdraw/trezor_withdraw_status/trezor_withdraw_status_request.dart
- lib/mm2/mm2_api/rpc/trezor/balance/trezor_balance_status/trezor_balance_status_request.dart
- lib/mm2/mm2_api/rpc/trezor/init/init_trezor/init_trezor_request.dart
- lib/mm2/mm2_api/rpc/trezor/withdraw/trezor_withdraw_cancel/trezor_withdraw_cancel_request.dart
- lib/mm2/mm2_api/rpc/trezor/init/init_trezor_cancel/init_trezor_cancel_request.dart
- lib/bloc/trezor_connection_bloc/trezor_connection_state.dart
- lib/mm2/mm2_api/rpc/trezor/init/init_trezor_status/init_trezor_status_request.dart
- lib/bloc/trezor_init_bloc/trezor_init_event.dart
- lib/mm2/mm2_api/rpc/trezor/enable_utxo/trezor_enable_utxo/trezor_enable_utxo_request.dart
- lib/mm2/mm2_api/rpc/trezor/enable_utxo/trezor_enable_utxo_status/trezor_enable_utxo_status_request.dart
- lib/mm2/mm2_api/rpc/trezor/enable_utxo/trezor_enable_utxo/trezor_enable_utxo_response.dart
- lib/bloc/trezor_connection_bloc/trezor_connection_bloc.dart
- lib/mm2/mm2_api/mm2_api.dart
- lib/views/wallet/coin_details/receive/receive_address_trezor.dart
- lib/mm2/mm2_api/rpc/trezor/init/init_trezor_status/init_trezor_status_response.dart
- lib/views/wallet/coin_details/receive/request_address_button.dart
- lib/model/hw_wallet/trezor_progress_status.dart
- lib/mm2/mm2_api/rpc/trezor/trezor_pin/trezor_pin_request.dart
- lib/bloc/app_bloc_root.dart
- lib/model/hw_wallet/trezor_status.dart
- lib/blocs/trezor_coins_bloc.dart
- lib/mm2/mm2_api/rpc/trezor/balance/trezor_balance_status/trezor_balance_status_response.dart
- lib/bloc/trezor_init_bloc/trezor_init_state.dart
- lib/mm2/mm2_api/rpc/trezor/balance/trezor_balance_init/trezor_balance_init_response.dart
- lib/bloc/trezor_init_bloc/trezor_init_bloc.dart
- lib/mm2/mm2_api/rpc/trezor/withdraw/trezor_withdraw/trezor_withdraw_response.dart
- lib/mm2/mm2_api/rpc/trezor/withdraw/trezor_withdraw/trezor_withdraw_request.dart
- lib/mm2/mm2_api/rpc/trezor/trezor_connection_status/trezor_connection_status_request.dart
- lib/mm2/mm2_api/rpc/trezor/withdraw/trezor_withdraw_status/trezor_withdraw_status_response.dart
- lib/mm2/mm2_api/rpc/trezor/enable_utxo/trezor_enable_utxo_status/trezor_enable_utxo_status_response.dart
- lib/model/hw_wallet/init_trezor.dart
- lib/mm2/mm2_api/rpc/trezor/get_new_address/get_new_address_request.dart
- lib/mm2/mm2_api/rpc/trezor/get_new_address/get_new_address_response.dart
- lib/mm2/mm2_api/mm2_api_trezor.dart
- lib/bloc/trezor_bloc/trezor_repo.dart
🧰 Additional context used
🧠 Learnings (21)
lib/views/wallet/coin_details/transactions/transaction_list_item.dart (2)
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The `excludedAssetList` from `app_config.dart` is used in the `_filterExcludedAssets` method in `coins_state.dart`. Since `coins_state.dart` is a part file of `coins_bloc.dart`, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.
lib/bloc/coins_manager/coins_manager_bloc.dart (2)
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The `excludedAssetList` from `app_config.dart` is used in the `_filterExcludedAssets` method in `coins_state.dart`. Since `coins_state.dart` is a part file of `coins_bloc.dart`, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
lib/views/wallet/wallet_page/charts/coin_prices_chart.dart (2)
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The `excludedAssetList` from `app_config.dart` is used in the `_filterExcludedAssets` method in `coins_state.dart`. Since `coins_state.dart` is a part file of `coins_bloc.dart`, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
lib/views/common/hw_wallet_dialog/hw_dialog_init.dart (6)
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The `excludedAssetList` from `app_config.dart` is used in the `_filterExcludedAssets` method in `coins_state.dart`. Since `coins_state.dart` is a part file of `coins_bloc.dart`, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2608
File: lib/bloc/fiat/fiat_onramp_form/fiat_form_bloc.dart:2-3
Timestamp: 2025-05-01T21:00:36.970Z
Learning: It's acceptable to use unconditional `dart:io` imports in the Komodo wallet codebase when the usage is guarded by `!kIsWeb` conditional checks that prevent the platform-specific code from being executed in web environments.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/http_head_time_provider_test.dart:8-24
Timestamp: 2025-05-08T19:05:13.083Z
Learning: In the Komodo Wallet project, test functions are defined in individual files under `test_units/tests/` but are executed through the central entry point in `test_units/main.dart`, so individual test files don't need their own `main()` function.
lib/bloc/cex_market_data/price_chart/price_chart_state.dart (3)
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The `excludedAssetList` from `app_config.dart` is used in the `_filterExcludedAssets` method in `coins_state.dart`. Since `coins_state.dart` is a part file of `coins_bloc.dart`, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2608
File: lib/bloc/fiat/fiat_onramp_form/fiat_form_bloc.dart:2-3
Timestamp: 2025-05-01T21:00:36.970Z
Learning: It's acceptable to use unconditional `dart:io` imports in the Komodo wallet codebase when the usage is guarded by `!kIsWeb` conditional checks that prevent the platform-specific code from being executed in web environments.
lib/model/wallet.dart (2)
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The `excludedAssetList` from `app_config.dart` is used in the `_filterExcludedAssets` method in `coins_state.dart`. Since `coins_state.dart` is a part file of `coins_bloc.dart`, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.
lib/views/common/hw_wallet_dialog/show_trezor_passphrase_dialog.dart (6)
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The `excludedAssetList` from `app_config.dart` is used in the `_filterExcludedAssets` method in `coins_state.dart`. Since `coins_state.dart` is a part file of `coins_bloc.dart`, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2608
File: lib/bloc/fiat/fiat_onramp_form/fiat_form_bloc.dart:2-3
Timestamp: 2025-05-01T21:00:36.970Z
Learning: It's acceptable to use unconditional `dart:io` imports in the Komodo wallet codebase when the usage is guarded by `!kIsWeb` conditional checks that prevent the platform-specific code from being executed in web environments.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/http_head_time_provider_test.dart:8-24
Timestamp: 2025-05-08T19:05:13.083Z
Learning: In the Komodo Wallet project, test functions are defined in individual files under `test_units/tests/` but are executed through the central entry point in `test_units/main.dart`, so individual test files don't need their own `main()` function.
test_units/tests/utils/transaction_history/sanitize_transaction_test.dart (1)
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/http_head_time_provider_test.dart:8-24
Timestamp: 2025-05-08T19:05:13.083Z
Learning: In the Komodo Wallet project, test functions are defined in individual files under `test_units/tests/` but are executed through the central entry point in `test_units/main.dart`, so individual test files don't need their own `main()` function.
lib/views/wallet/coins_manager/coins_manager_filters_dropdown.dart (2)
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The `excludedAssetList` from `app_config.dart` is used in the `_filterExcludedAssets` method in `coins_state.dart`. Since `coins_state.dart` is a part file of `coins_bloc.dart`, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
lib/main.dart (6)
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The `excludedAssetList` from `app_config.dart` is used in the `_filterExcludedAssets` method in `coins_state.dart`. Since `coins_state.dart` is a part file of `coins_bloc.dart`, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/http_head_time_provider_test.dart:8-24
Timestamp: 2025-05-08T19:05:13.083Z
Learning: In the Komodo Wallet project, test functions are defined in individual files under `test_units/tests/` but are executed through the central entry point in `test_units/main.dart`, so individual test files don't need their own `main()` function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2608
File: lib/bloc/fiat/fiat_onramp_form/fiat_form_bloc.dart:2-3
Timestamp: 2025-05-01T21:00:36.970Z
Learning: It's acceptable to use unconditional `dart:io` imports in the Komodo wallet codebase when the usage is guarded by `!kIsWeb` conditional checks that prevent the platform-specific code from being executed in web environments.
lib/views/common/hw_wallet_dialog/show_trezor_pin_dialog.dart (6)
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The `excludedAssetList` from `app_config.dart` is used in the `_filterExcludedAssets` method in `coins_state.dart`. Since `coins_state.dart` is a part file of `coins_bloc.dart`, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2608
File: lib/bloc/fiat/fiat_onramp_form/fiat_form_bloc.dart:2-3
Timestamp: 2025-05-01T21:00:36.970Z
Learning: It's acceptable to use unconditional `dart:io` imports in the Komodo wallet codebase when the usage is guarded by `!kIsWeb` conditional checks that prevent the platform-specific code from being executed in web environments.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/http_head_time_provider_test.dart:8-24
Timestamp: 2025-05-08T19:05:13.083Z
Learning: In the Komodo Wallet project, test functions are defined in individual files under `test_units/tests/` but are executed through the central entry point in `test_units/main.dart`, so individual test files don't need their own `main()` function.
lib/bloc/coins_bloc/coins_repo.dart (6)
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The `excludedAssetList` from `app_config.dart` is used in the `_filterExcludedAssets` method in `coins_state.dart`. Since `coins_state.dart` is a part file of `coins_bloc.dart`, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2608
File: lib/bloc/fiat/fiat_onramp_form/fiat_form_bloc.dart:2-3
Timestamp: 2025-05-01T21:00:36.970Z
Learning: It's acceptable to use unconditional `dart:io` imports in the Komodo wallet codebase when the usage is guarded by `!kIsWeb` conditional checks that prevent the platform-specific code from being executed in web environments.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/http_head_time_provider_test.dart:8-24
Timestamp: 2025-05-08T19:05:13.083Z
Learning: In the Komodo Wallet project, test functions are defined in individual files under `test_units/tests/` but are executed through the central entry point in `test_units/main.dart`, so individual test files don't need their own `main()` function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.
lib/bloc/auth_bloc/auth_bloc.dart (6)
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The `excludedAssetList` from `app_config.dart` is used in the `_filterExcludedAssets` method in `coins_state.dart`. Since `coins_state.dart` is a part file of `coins_bloc.dart`, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2608
File: lib/bloc/fiat/fiat_onramp_form/fiat_form_bloc.dart:2-3
Timestamp: 2025-05-01T21:00:36.970Z
Learning: It's acceptable to use unconditional `dart:io` imports in the Komodo wallet codebase when the usage is guarded by `!kIsWeb` conditional checks that prevent the platform-specific code from being executed in web environments.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/http_head_time_provider_test.dart:8-24
Timestamp: 2025-05-08T19:05:13.083Z
Learning: In the Komodo Wallet project, test functions are defined in individual files under `test_units/tests/` but are executed through the central entry point in `test_units/main.dart`, so individual test files don't need their own `main()` function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.
lib/views/common/hw_wallet_dialog/trezor_steps/trezor_dialog_in_progress.dart (6)
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2608
File: lib/bloc/fiat/fiat_onramp_form/fiat_form_bloc.dart:2-3
Timestamp: 2025-05-01T21:00:36.970Z
Learning: It's acceptable to use unconditional `dart:io` imports in the Komodo wallet codebase when the usage is guarded by `!kIsWeb` conditional checks that prevent the platform-specific code from being executed in web environments.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/http_head_time_provider_test.dart:8-24
Timestamp: 2025-05-08T19:05:13.083Z
Learning: In the Komodo Wallet project, test functions are defined in individual files under `test_units/tests/` but are executed through the central entry point in `test_units/main.dart`, so individual test files don't need their own `main()` function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The `excludedAssetList` from `app_config.dart` is used in the `_filterExcludedAssets` method in `coins_state.dart`. Since `coins_state.dart` is a part file of `coins_bloc.dart`, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.
lib/views/common/hw_wallet_dialog/hw_dialog_wallet_select.dart (6)
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The `excludedAssetList` from `app_config.dart` is used in the `_filterExcludedAssets` method in `coins_state.dart`. Since `coins_state.dart` is a part file of `coins_bloc.dart`, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2608
File: lib/bloc/fiat/fiat_onramp_form/fiat_form_bloc.dart:2-3
Timestamp: 2025-05-01T21:00:36.970Z
Learning: It's acceptable to use unconditional `dart:io` imports in the Komodo wallet codebase when the usage is guarded by `!kIsWeb` conditional checks that prevent the platform-specific code from being executed in web environments.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/http_head_time_provider_test.dart:8-24
Timestamp: 2025-05-08T19:05:13.083Z
Learning: In the Komodo Wallet project, test functions are defined in individual files under `test_units/tests/` but are executed through the central entry point in `test_units/main.dart`, so individual test files don't need their own `main()` function.
lib/bloc/auth_bloc/auth_bloc_event.dart (1)
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
lib/views/common/hw_wallet_dialog/trezor_steps/trezor_dialog_error.dart (3)
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The `excludedAssetList` from `app_config.dart` is used in the `_filterExcludedAssets` method in `coins_state.dart`. Since `coins_state.dart` is a part file of `coins_bloc.dart`, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2608
File: lib/bloc/fiat/fiat_onramp_form/fiat_form_bloc.dart:2-3
Timestamp: 2025-05-01T21:00:36.970Z
Learning: It's acceptable to use unconditional `dart:io` imports in the Komodo wallet codebase when the usage is guarded by `!kIsWeb` conditional checks that prevent the platform-specific code from being executed in web environments.
lib/bloc/coins_bloc/coins_bloc.dart (6)
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The `excludedAssetList` from `app_config.dart` is used in the `_filterExcludedAssets` method in `coins_state.dart`. Since `coins_state.dart` is a part file of `coins_bloc.dart`, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2608
File: lib/bloc/fiat/fiat_onramp_form/fiat_form_bloc.dart:2-3
Timestamp: 2025-05-01T21:00:36.970Z
Learning: It's acceptable to use unconditional `dart:io` imports in the Komodo wallet codebase when the usage is guarded by `!kIsWeb` conditional checks that prevent the platform-specific code from being executed in web environments.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/http_head_time_provider_test.dart:8-24
Timestamp: 2025-05-08T19:05:13.083Z
Learning: In the Komodo Wallet project, test functions are defined in individual files under `test_units/tests/` but are executed through the central entry point in `test_units/main.dart`, so individual test files don't need their own `main()` function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.
lib/bloc/cex_market_data/price_chart/price_chart_bloc.dart (6)
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The `excludedAssetList` from `app_config.dart` is used in the `_filterExcludedAssets` method in `coins_state.dart`. Since `coins_state.dart` is a part file of `coins_bloc.dart`, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2608
File: lib/bloc/fiat/fiat_onramp_form/fiat_form_bloc.dart:2-3
Timestamp: 2025-05-01T21:00:36.970Z
Learning: It's acceptable to use unconditional `dart:io` imports in the Komodo wallet codebase when the usage is guarded by `!kIsWeb` conditional checks that prevent the platform-specific code from being executed in web environments.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/http_head_time_provider_test.dart:8-24
Timestamp: 2025-05-08T19:05:13.083Z
Learning: In the Komodo Wallet project, test functions are defined in individual files under `test_units/tests/` but are executed through the central entry point in `test_units/main.dart`, so individual test files don't need their own `main()` function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.
lib/bloc/auth_bloc/trezor_auth_mixin.dart (1)
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
lib/views/wallets_manager/widgets/hardware_wallets_manager.dart (6)
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The `excludedAssetList` from `app_config.dart` is used in the `_filterExcludedAssets` method in `coins_state.dart`. Since `coins_state.dart` is a part file of `coins_bloc.dart`, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2608
File: lib/bloc/fiat/fiat_onramp_form/fiat_form_bloc.dart:2-3
Timestamp: 2025-05-01T21:00:36.970Z
Learning: It's acceptable to use unconditional `dart:io` imports in the Komodo wallet codebase when the usage is guarded by `!kIsWeb` conditional checks that prevent the platform-specific code from being executed in web environments.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/http_head_time_provider_test.dart:8-24
Timestamp: 2025-05-08T19:05:13.083Z
Learning: In the Komodo Wallet project, test functions are defined in individual files under `test_units/tests/` but are executed through the central entry point in `test_units/main.dart`, so individual test files don't need their own `main()` function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.
🪛 GitHub Actions: takenagain is validating code guidelines 🚀
lib/views/wallet/coin_details/transactions/transaction_list_item.dart
[warning] 258-258: 'getUsdPriceByAmount' is deprecated. Use sdk.prices.fiatPrice(assetId) * amount instead.
lib/views/wallet/wallet_page/charts/coin_prices_chart.dart
[warning] 6-6: Unused import: 'package:komodo_defi_sdk/komodo_defi_sdk.dart'.
[warning] 14-14: Unused import: 'package:web_dex/bloc/coins_bloc/asset_coin_extension.dart'.
lib/bloc/coins_bloc/coins_repo.dart
[warning] 73-616: 'getCoin', 'getFirstPubkey', 'call', and 'usdPrice' are deprecated. Use KomodoDefiSdk assets, pubkeys.getPubkeys, client.rpc or client.executeRpc, and sdk.prices.fiatPrice(id) respectively.
lib/bloc/auth_bloc/auth_bloc.dart
[warning] 288-288: 'downloadEncryptedWallet' is deprecated. Use KomodoDefiSdk.auth.getMnemonicEncrypted instead.
lib/bloc/coins_bloc/coins_bloc.dart
[warning] 343-357: 'enabledType' and 'reset' are deprecated. Use SDK's WalletManager and Asset state management respectively. This must be fixed before the next release.
lib/bloc/cex_market_data/price_chart/price_chart_bloc.dart
[warning] 104-104: 'assetsFromTicker' is deprecated. Intended for transition to KDF SDK.
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build-android-docker
🔇 Additional comments (41)
lib/views/wallet/wallet_page/charts/coin_prices_chart.dart (1)
54-54
: LGTM! Simplified coin list construction.The change correctly adapts to the new
Map<AssetId, CoinPriceInfo>
type by directly using the keys, eliminating the need for the previous mapping throughgetSdkAsset
.lib/views/wallet/coin_details/transactions/transaction_list_item.dart (1)
286-294
: Excellent defensive programming!The change properly handles edge cases where address lists might be empty, preventing potential runtime exceptions when accessing
addressList.first
. The fallback toLocaleKeys.unknown.tr()
provides a graceful user experience.lib/bloc/cex_market_data/price_chart/price_chart_state.dart (3)
2-2
: LGTM! Import addition for AssetId type.The import is correctly added to support the new
AssetId
type used in the state.
12-12
: LGTM! Improved type safety with AssetId.The change from
Map<String, CoinPriceInfo>
toMap<AssetId, CoinPriceInfo>
enhances type safety and consistency throughout the price chart feature.
32-32
: LGTM! Consistent parameter type update.The
copyWith
method parameter type is correctly updated to match the field type change, maintaining consistency across the class.lib/shared/utils/extensions/transaction_extensions.dart (1)
16-18
: Excellent improvement for self-transfer handling!The conditional logic properly handles self-transfer scenarios where the sender is the only recipient. This prevents creating empty recipient lists while maintaining the original functionality for multi-recipient transactions.
test_units/tests/utils/transaction_history/sanitize_transaction_test.dart (2)
41-61
: Excellent test coverage for self-transfer scenarios!The new test group comprehensively validates the edge case where a transaction's
from
andto
contain the same single address, ensuring the sanitize method handles self-transfers correctly without creating empty address lists.
108-108
: Correct test expectation update.The expectation is properly updated to align with the new conditional logic in the
sanitize
method, where the sender address remains when it's the only recipient.lib/bloc/cex_market_data/price_chart/price_chart_bloc.dart (5)
4-5
: LGTM! Import changes support the refactoring.The new imports for
komodo_defi_types
andasset_coin_extension
are necessary for theAssetId
type usage and SDK asset operations in the refactored code.
32-34
: Good refactoring approach with conditional fetching.The conditional fetching logic prevents unnecessary API calls when coin data is already available, which is an efficient pattern.
37-42
: Proper SDK integration with AssetId types.The migration from string-based symbols to
AssetId
objects is correctly implemented and aligns with the SDK modernization effort. The use ofsdk.getSdkAsset()
and proper asset ID extraction follows the expected patterns.Also applies to: 55-55
121-123
: Consistent error handling approach.The error handling for individual coin OHLC fetching follows the same pattern as the existing code - logging errors and gracefully continuing with other coins. This ensures robustness when some coins fail to fetch data.
96-139
: Address potential deprecation ofassetsFromTicker
and optimize async concurrencyA few spots to verify and improve:
Deprecation of
assetsFromTicker
In
lib/bloc/cex_market_data/price_chart/price_chart_bloc.dart:104
replace.where((coin) => sdk.assets.assetsFromTicker(coin.id).isNotEmpty)with the non-deprecated KDF SDK API once confirmed (e.g.
.where((coin) => kdfSdk.assets.lookupByTicker(coin.id).isNotEmpty)or whatever the new method is).
Async concurrency in your map + Future.wait
You build a list of async closures viafinal coins = coinList.map((coin) async { … }).toList(); final fetchedCexCoins = { for (var coin in await Future.wait(coins)) … };For large coin lists this can spawn too many parallel requests. Consider using a
Stream
or batching, for example:await Stream.fromIterable(coinList) .asyncMap((coin) async { … }) .toList();or splitting the list into smaller chunks.
Let me know once you’ve confirmed the replacement method in the KDF SDK and adjusted the concurrency model.
lib/model/wallet.dart (1)
169-170
: LGTM! Formatting improvement maintains functionality.The reformatting of the
activatedCoins
assignment improves readability while preserving the exact same functionality. This aligns well with the broader Trezor migration effort.lib/views/wallet/coins_manager/coins_manager_filters_dropdown.dart (1)
152-154
: Correctly removes Trezor-specific filtering logic.The removal of the
hasTrezorSupport
condition aligns perfectly with the migration strategy. Trezor wallets now use the same filtering logic as other wallet types, which is consistent with the broader removal of Trezor-specific support throughout the codebase.assets/translations/en.json (1)
336-336
: Good catch fixing the typographical error.Removing the extraneous single quote improves the translation string quality and ensures clean user-facing messages.
lib/main.dart (1)
64-64
: Correctly simplifies CoinsRepo initialization.Removing the
trezorBloc
parameter from theCoinsRepo
constructor aligns with the migration strategy of eliminating standalone Trezor integration and consolidating hardware wallet functionality within the general authentication framework.lib/bloc/coins_manager/coins_manager_bloc.dart (1)
273-276
: Correctly consolidates wallet type handling.Grouping
WalletType.trezor
withWalletType.iguana
andWalletType.hdwallet
is the right approach for the migration. This eliminates Trezor-specific filtering logic and treats all these wallet types consistently, which aligns with the broader removal of Trezor-specific support throughout the codebase.lib/views/common/hw_wallet_dialog/hw_dialog_init.dart (2)
4-4
: LGTM: Import migration to AuthBlocThe import change from TrezorInitBloc to AuthBloc aligns with the architectural migration to consolidate Trezor authentication within the unified AuthBloc.
22-23
: LGTM: Consistent migration to AuthBloc state and eventsThe changes correctly update the loading state check from
TrezorInitBloc.inProgress
toAuthBloc.isLoading
and dispatch the appropriateAuthTrezorInitAndAuthStarted
event. The logic and flow remain functionally equivalent.lib/views/common/hw_wallet_dialog/hw_dialog_wallet_select.dart (2)
7-7
: LGTM: Import migration to AuthBlocThe import change correctly reflects the migration from TrezorInitBloc to the unified AuthBloc approach.
87-88
: LGTM: BlocSelector migration maintains UI behaviorThe BlocSelector is correctly updated to use
AuthBloc
andAuthBlocState
, with the selector extracting theisLoading
property instead ofinProgress
. This maintains the same UI loading state behavior.lib/views/common/hw_wallet_dialog/show_trezor_pin_dialog.dart (2)
3-3
: LGTM: Import migration to AuthBlocThe import change from TrezorRepo to AuthBloc aligns with the migration away from dedicated Trezor repositories to unified authentication handling.
27-28
: LGTM: Proper migration to BLoC event patternThe change from calling
TrezorRepo.sendPin()
to dispatchingAuthTrezorPinProvided
event to AuthBloc follows proper BLoC architecture patterns. This maintains separation of concerns and ensures consistent state management.lib/views/common/hw_wallet_dialog/show_trezor_passphrase_dialog.dart (2)
3-3
: LGTM: Import migration to AuthBlocThe import change from TrezorRepo to AuthBloc is consistent with the overall migration strategy.
28-29
: LGTM: Consistent BLoC event pattern migrationThe migration from
TrezorRepo.sendPassphrase()
to dispatchingAuthTrezorPassphraseProvided
event maintains functionality while following proper BLoC architecture patterns, consistent with the PIN dialog changes.lib/bloc/auth_bloc/auth_bloc.dart (5)
8-9
: LGTM: Import addition for Trezor functionalityThe import of
PrivateKeyPolicy
fromkomodo_defi_rpc_methods
is appropriately scoped and likely required for the new Trezor authentication functionality in the mixin.
19-19
: LGTM: Trezor mixin integrationThe part declaration for
trezor_auth_mixin.dart
properly integrates Trezor-specific authentication logic into the AuthBloc structure.
23-23
: LGTM: Mixin pattern for Trezor authenticationUsing
TrezorAuthMixin
allows for clean separation of Trezor-specific authentication logic while keeping it integrated within the main AuthBloc. This is a good architectural choice.
36-36
: LGTM: Trezor event handlers setupThe call to
setupTrezorEventHandlers()
in the constructor ensures Trezor-specific event handling is properly initialized when the AuthBloc is created.
45-46
: LGTM: SDK access for mixinThe override getter provides the TrezorAuthMixin with access to the KomodoDefiSdk instance, enabling proper integration between the mixin and the main bloc functionality.
lib/bloc/coins_bloc/coins_repo.dart (2)
34-36
: LGTM! Clean removal of Trezor integrationThe constructor has been properly updated to remove the Trezor-specific dependencies.
560-560
: Clean removal of Trezor-specific balance update logicThe removal of
updateTrezorBalances
is consistent with the migration to SDK-based Trezor handling.lib/views/common/hw_wallet_dialog/trezor_steps/trezor_dialog_in_progress.dart (1)
3-3
: Successful migration to SDK's AuthenticationStatusThe widget has been properly updated to use the SDK's
AuthenticationStatus
enum instead of the customTrezorProgressStatus
. The status checks have been correctly mapped to the new enum values.Also applies to: 14-14, 29-34
lib/bloc/auth_bloc/auth_bloc_event.dart (1)
57-75
: Well-structured Trezor authentication eventsThe new Trezor-related events are properly implemented and follow the established event pattern. They provide clear interfaces for:
- Starting Trezor authentication
- Providing PIN input
- Providing passphrase input
- Cancelling the authentication flow
lib/views/common/hw_wallet_dialog/trezor_steps/trezor_dialog_error.dart (1)
32-32
: Correct event dispatch to AuthBlocThe retry button now properly dispatches
AuthTrezorCancelled
event to theAuthBloc
, which is consistent with the new authentication flow.lib/bloc/coins_bloc/coins_bloc.dart (3)
389-391
: Good defensive programming with known coins filteringThe additional filter
.where((coin) => _coinsRepo.getKnownCoinsMap().containsKey(coin))
ensures only coins known to the repository are activated. This prevents potential issues with unknown or invalid coin IDs.
449-453
: Successful consolidation of Trezor activation logicThe Trezor wallet type now shares the same activation path as iguana/hdwallet types, which simplifies the code and aligns with the SDK-based approach.
413-432
: Verify Activated Coins Against Known Coins Map
Now that_activateCoins
sources exclusively from_coinsRepo.getKnownCoinsMap()
, any coin ID inconfig.activatedCoins
not present in that map will be dropped. Manually confirm that your default and persisted activated coins lists only contain valid IDs by checking these locations:
- lib/bloc/wallets_repository.dart →
wallet.config.activatedCoins
- lib/bloc/auth_bloc/auth_bloc.dart →
_kdfSdk.addActivatedCoins(event.wallet.config.activatedCoins)
- lib/bloc/coins_bloc/coins_bloc.dart →
_activateCoins(currentWallet.config.activatedCoins, emit)
- lib/bloc/auth_bloc/trezor_auth_mixin.dart →
authState.user!.wallet.config.activatedCoins
lib/views/wallets_manager/widgets/hardware_wallets_manager.dart (1)
51-91
: Clean migration to AuthBlocThe migration from
TrezorInitBloc
toAuthBloc
is well implemented with proper event handling and state management.lib/bloc/auth_bloc/trezor_auth_mixin.dart (1)
119-119
: enabledByDefaultCoins is available via the parent file importThe parent auth_bloc.dart imports app_config.dart, which defines enabledByDefaultCoins. As a part file, trezor_auth_mixin.dart shares the parent’s namespace and has access to that getter. No changes needed.
Confirmed BCH activation failing. This has been reported in KDF repo. {
"mmrpc": "2.0",
"error": "Error on platform coin BCH creation: DataError",
"error_path": "lib.common_impl.coin_balance.mod.pubkey.client",
"error_type": "CoinCreationError",
"error_data": {
"ticker": "BCH",
"error": "DataError"
},
"error_trace": "lib:104] common_impl:66] coin_balance:493] mod:417] pubkey:154] client:93]",
"object": {
"mmrpc": "2.0",
"result": {
"status": "Error",
"details": {
"error": "Error on platform coin BCH creation: DataError",
"error_path": "lib.common_impl.coin_balance.mod.pubkey.client",
"error_trace": "lib:104] common_impl:66] coin_balance:493] mod:417] pubkey:154] client:93]",
"error_type": "CoinCreationError",
"error_data": {
"ticker": "BCH",
"error": "DataError"
}
}
},
"id": null
}
} Suggest we add BCH to the exclusion list until resolved. |
Another error seen in logs after leaving session running while tending to the hounds:
In this state, Trezor Model 1 is lit up with numeric grid, but no way to make input in gui (and model one only has 2 buttons, so cant do on device). Forced to restart device and app to continue. If possible, the ability to "restore session" would be nice, if https://c774543c.komodo-docs.pages.dev/en/docs/komodo-defi-framework/api/v20/utils/trezor_connection_status/ indicates the connection was lost. |
Trezor address creation functioning, but there is no preview in GUI to confirm with the device. The normal flow is
{
"mmrpc": "2.0",
"result": {
"status": "InProgress",
"details": {
"ConfirmAddress": {
"expected_address": "QSHn5mCGjbAw5NvBX8FjrygmhrAxG1Mdxz"
}
}
},
"id": null
}
|
* feat(wallet): use pubkey stream for address creation * fix(coin-addresses): layoutbuilder size constraint in confirmation popup * chore(deps): bump SDK to ce68c7a80 for pubkey event streaming * refactor(coin-addresses): use consumer and more declarative approach * refactor: remove unnecessary dynamic cast
Summary
Migration of Trezor functionality to the SDK.
get_new_address
RPC for address creation.enabledByDefaultCoins
lists.priv_key_policy
to coin activation params and add task-based ETH activation RPC.Fixes the following issues
Remaining issues not resolved here
Summary by CodeRabbit
New Features
Bug Fixes
Refactor
Style
Tests
Chores