Repository navigation
Conversation
|
Important Review skippedToo many files! This PR contains 95 files, which is 45 over the limit of 50. To get a review, narrow the scope: Upgrade to a paid plan to raise the limit. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (105)
You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThis change removes CoinJoin services, UI, persistence, analytics, and mixed-balance APIs. Wallet and DashPay flows now use total balances, blockchain synchronization uses a shared ChangesWallet and CoinJoin removal
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
83ce13c to
d44b6a5
Compare
|
Slimmed this PR to 150 files (the automated reviewer's limit — it skipped at 156): five standalone unreferenced assets moved to the stacked follow-up #1513, and the migration-plan doc moves to the upcoming SDK-integration PR. No code difference; compile + full unit-test gate re-verified on the slimmed branch. The new push should trigger the automated review. |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (4)
wallet/src/de/schildbach/wallet/ui/more/ConfirmInviteDialogFragment.kt (1)
60-61: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRename
spendableBalanceto reflect the updated balance source.Since the balance is now being fetched using
observeTotalBalance(), consider renaming the local variablespendableBalancetototalBalanceto avoid confusion.♻️ Proposed refactor
- val spendableBalance = invitationFragmentViewModel.walletData.observeTotalBalance().first() - if (spendableBalance < inviteAmount) { + val totalBalance = invitationFragmentViewModel.walletData.observeTotalBalance().first() + if (totalBalance < inviteAmount) {🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@wallet/src/de/schildbach/wallet/ui/more/ConfirmInviteDialogFragment.kt` around lines 60 - 61, Rename the local variable spendableBalance to totalBalance in the invite confirmation balance check, including its comparison with inviteAmount, to match the observeTotalBalance() source.integrations/coinbase/src/main/java/org/dash/wallet/integrations/coinbase/viewmodels/TransferDashViewModel.kt (1)
101-103: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoffConsolidate state streams into a single
UIStatedata class. As per coding guidelines, ViewModels should use a singleUIStatedata class rather than multiple separate flows, and must useStateFlow(notLiveData) for asynchronously updated fields. Consider refactoring the state management in these files to align with the architectural guidelines.
integrations/coinbase/src/main/java/org/dash/wallet/integrations/coinbase/viewmodels/TransferDashViewModel.kt#L101-L103: Migrate theLiveData(like_dashBalanceInWalletState) toStateFlowand consolidate into a singleUIState.wallet/src/de/schildbach/wallet/ui/send/SendCoinsViewModel.kt#L146-L149: MigrateLiveData(like_maxOutputAmount) toStateFlowand consolidate into a singleUIState.wallet/src/de/schildbach/wallet/ui/username/request/RequestUserNameViewModel.kt#L244-L248: Consolidate the multiple separateStateFlowproperties (e.g.,_walletBalance,_identityBalance) intoRequestUserNameUIState.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@integrations/coinbase/src/main/java/org/dash/wallet/integrations/coinbase/viewmodels/TransferDashViewModel.kt` around lines 101 - 103, Consolidate asynchronously updated ViewModel state into one immutable UIState StateFlow per screen. In integrations/coinbase/src/main/java/org/dash/wallet/integrations/coinbase/viewmodels/TransferDashViewModel.kt lines 101-103, replace the _dashBalanceInWalletState LiveData update with the relevant UIState field update; in wallet/src/de/schildbach/wallet/ui/send/SendCoinsViewModel.kt lines 146-149, migrate _maxOutputAmount and related state into its UIState StateFlow; in wallet/src/de/schildbach/wallet/ui/username/request/RequestUserNameViewModel.kt lines 244-248, merge _walletBalance, _identityBalance, and other separate state flows into RequestUserNameUIState while preserving existing state updates and consumers.Source: Coding guidelines
wallet/src/de/schildbach/wallet/ui/invite/CreateInviteViewModel.kt (1)
65-69: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoffRename
spendableBalanceand consolidate state flows into a singleUIState.The balance observation has been updated to use
observeTotalBalance(), but the result is still being stored in thespendableBalanceproperty. Consider renaming this property tototalBalanceto accurately reflect its content and avoid confusion.Additionally, this ViewModel uses multiple separate
MutableStateFlowproperties (e.g.,spendableBalance,invitations,blockchainStateData). As per coding guidelines, ViewModels should use a singleUIStatedata class with a private mutable_uiStateand a public immutableuiStateviaasStateFlow().🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@wallet/src/de/schildbach/wallet/ui/invite/CreateInviteViewModel.kt` around lines 65 - 69, Rename the balance state from spendableBalance to totalBalance throughout the CreateInviteViewModel and its consumers. Consolidate totalBalance, invitations, and blockchainStateData into a single UIState data class backed by private mutable _uiState and exposed through public uiState.asStateFlow(), updating each field via state copies while preserving existing behavior.Source: Coding guidelines
features/exploredash/src/main/java/org/dash/wallet/features/exploredash/ui/dashspend/DashSpendViewModel.kt (1)
226-230: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy liftRepresent asynchronously observed balances in the ViewModels’ single
StateFlowUI state.
features/exploredash/src/main/java/org/dash/wallet/features/exploredash/ui/dashspend/DashSpendViewModel.kt#L226-L230: updateDashSpendStaterather than_balanceLiveData.wallet/src/de/schildbach/wallet/ui/main/MainViewModel.kt#L282-L287: add total balance to the consolidated UI state rather than_totalBalanceLiveData.As per coding guidelines, ViewModels must use a single
UIStateandStateFlowfor asynchronously updated fields.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@features/exploredash/src/main/java/org/dash/wallet/features/exploredash/ui/dashspend/DashSpendViewModel.kt` around lines 226 - 230, Replace the asynchronous balance updates in DashSpendViewModel.kt at lines 226-230 so observeTotalBalance() updates the balance field within DashSpendState rather than _balance LiveData. In wallet/src/de/schildbach/wallet/ui/main/MainViewModel.kt at lines 282-287, update the consolidated UI state with total balance instead of _totalBalance LiveData; preserve distinctUntilChanged and existing collection scopes.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@wallet/src/de/schildbach/wallet/service/platform/TopUpRepository.kt`:
- Line 207: Update both emptyWallet calculations in
wallet/src/de/schildbach/wallet/service/platform/TopUpRepository.kt at lines
207-207 and 564-564 to use balance >= topupAmount while retaining the upper
dust-threshold check. Apply the same condition consistently at both sites.
In `@wallet/src/de/schildbach/wallet/ui/main/MainActivityExt.kt`:
- Around line 282-289: Update MainActivity.showTimeSkewAlertDialog to pass the
absolute minute difference to wallet_timeskew_dialog_msg by restoring
kotlin.math.abs and wrapping diffSeconds / 60 with abs(...), ensuring the
displayed minute count is non-negative.
In `@wallet/test/de/schildbach/wallet/util/services/SendCoinsTaskRunnerTest.kt`:
- Line 46: Correct both SendCoinsTaskRunner constructor calls in
wallet/test/de/schildbach/wallet/util/services/SendCoinsTaskRunnerTest.kt at
lines 46-46 and 64-64 by passing the WalletDataProvider mock as the first
argument and application (WalletApplication) as the second argument.
---
Nitpick comments:
In
`@features/exploredash/src/main/java/org/dash/wallet/features/exploredash/ui/dashspend/DashSpendViewModel.kt`:
- Around line 226-230: Replace the asynchronous balance updates in
DashSpendViewModel.kt at lines 226-230 so observeTotalBalance() updates the
balance field within DashSpendState rather than _balance LiveData. In
wallet/src/de/schildbach/wallet/ui/main/MainViewModel.kt at lines 282-287,
update the consolidated UI state with total balance instead of _totalBalance
LiveData; preserve distinctUntilChanged and existing collection scopes.
In
`@integrations/coinbase/src/main/java/org/dash/wallet/integrations/coinbase/viewmodels/TransferDashViewModel.kt`:
- Around line 101-103: Consolidate asynchronously updated ViewModel state into
one immutable UIState StateFlow per screen. In
integrations/coinbase/src/main/java/org/dash/wallet/integrations/coinbase/viewmodels/TransferDashViewModel.kt
lines 101-103, replace the _dashBalanceInWalletState LiveData update with the
relevant UIState field update; in
wallet/src/de/schildbach/wallet/ui/send/SendCoinsViewModel.kt lines 146-149,
migrate _maxOutputAmount and related state into its UIState StateFlow; in
wallet/src/de/schildbach/wallet/ui/username/request/RequestUserNameViewModel.kt
lines 244-248, merge _walletBalance, _identityBalance, and other separate state
flows into RequestUserNameUIState while preserving existing state updates and
consumers.
In `@wallet/src/de/schildbach/wallet/ui/invite/CreateInviteViewModel.kt`:
- Around line 65-69: Rename the balance state from spendableBalance to
totalBalance throughout the CreateInviteViewModel and its consumers. Consolidate
totalBalance, invitations, and blockchainStateData into a single UIState data
class backed by private mutable _uiState and exposed through public
uiState.asStateFlow(), updating each field via state copies while preserving
existing behavior.
In `@wallet/src/de/schildbach/wallet/ui/more/ConfirmInviteDialogFragment.kt`:
- Around line 60-61: Rename the local variable spendableBalance to totalBalance
in the invite confirmation balance check, including its comparison with
inviteAmount, to match the observeTotalBalance() source.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 7d59beed-4dcd-4e78-9c19-4a46a03203ea
📒 Files selected for processing (150)
common/src/main/java/org/dash/wallet/common/WalletDataProvider.ktcommon/src/main/java/org/dash/wallet/common/data/SyncStage.ktcommon/src/main/java/org/dash/wallet/common/data/WalletUIConfig.ktcommon/src/main/java/org/dash/wallet/common/services/BlockchainStateProvider.ktcommon/src/main/java/org/dash/wallet/common/services/SendPaymentService.ktcommon/src/main/java/org/dash/wallet/common/services/analytics/AnalyticsConstants.ktcommon/src/main/java/org/dash/wallet/common/ui/components/MenuItem.ktcommon/src/main/res/values-de/strings.xmlcommon/src/main/res/values-el/strings.xmlcommon/src/main/res/values-es/strings.xmlcommon/src/main/res/values-fa/strings.xmlcommon/src/main/res/values-fil/strings.xmlcommon/src/main/res/values-fr/strings.xmlcommon/src/main/res/values-id/strings.xmlcommon/src/main/res/values-it/strings.xmlcommon/src/main/res/values-ja/strings.xmlcommon/src/main/res/values-ko/strings.xmlcommon/src/main/res/values-nl/strings.xmlcommon/src/main/res/values-pl/strings.xmlcommon/src/main/res/values-pt/strings.xmlcommon/src/main/res/values-ru/strings.xmlcommon/src/main/res/values-sk/strings.xmlcommon/src/main/res/values-uk/strings.xmlcommon/src/main/res/values-zh-rTW/strings.xmlcommon/src/main/res/values-zh/strings.xmlcommon/src/main/res/values/strings.xmlfeatures/exploredash/src/main/java/org/dash/wallet/features/exploredash/network/service/stubs/FakeDashSpendService.ktfeatures/exploredash/src/main/java/org/dash/wallet/features/exploredash/ui/dashspend/DashSpendViewModel.ktintegrations/coinbase/src/main/java/org/dash/wallet/integrations/coinbase/viewmodels/TransferDashViewModel.ktintegrations/crowdnode/src/main/java/org/dash/wallet/integrations/crowdnode/ui/CrowdNodeViewModel.ktintegrations/crowdnode/src/test/java/org/dash/wallet/integrations/crowdnode/CrowdNodeViewModelTest.ktwallet/AndroidManifest.xmlwallet/androidTest/de/schildbach/wallet/security/SecurityGuardMultiThreadingTest.ktwallet/res/layout/activity_coinjoin.xmlwallet/res/layout/dialog_mix_dash_first.xmlwallet/res/layout/fragment_coinjoin_info.xmlwallet/res/layout/fragment_coinjoin_level.xmlwallet/res/layout/fragment_request_username.xmlwallet/res/layout/home_content.xmlwallet/res/navigation/nav_coinjoin.xmlwallet/res/values-de/strings-dashpay.xmlwallet/res/values-de/strings-extra.xmlwallet/res/values-de/strings.xmlwallet/res/values-el/strings-dashpay.xmlwallet/res/values-el/strings-extra.xmlwallet/res/values-el/strings.xmlwallet/res/values-es/strings-dashpay.xmlwallet/res/values-es/strings-extra.xmlwallet/res/values-es/strings.xmlwallet/res/values-fa/strings-dashpay.xmlwallet/res/values-fa/strings-extra.xmlwallet/res/values-fa/strings.xmlwallet/res/values-fil/strings-dashpay.xmlwallet/res/values-fil/strings-extra.xmlwallet/res/values-fil/strings.xmlwallet/res/values-fr/strings-dashpay.xmlwallet/res/values-fr/strings-extra.xmlwallet/res/values-fr/strings.xmlwallet/res/values-id/strings-dashpay.xmlwallet/res/values-id/strings-extra.xmlwallet/res/values-id/strings.xmlwallet/res/values-it/strings-dashpay.xmlwallet/res/values-it/strings-extra.xmlwallet/res/values-it/strings.xmlwallet/res/values-ja/strings-dashpay.xmlwallet/res/values-ja/strings-extra.xmlwallet/res/values-ja/strings.xmlwallet/res/values-ko/strings-dashpay.xmlwallet/res/values-ko/strings-extra.xmlwallet/res/values-ko/strings.xmlwallet/res/values-nl/strings-dashpay.xmlwallet/res/values-nl/strings-extra.xmlwallet/res/values-nl/strings.xmlwallet/res/values-pl/strings-dashpay.xmlwallet/res/values-pl/strings-extra.xmlwallet/res/values-pl/strings.xmlwallet/res/values-pt/strings-dashpay.xmlwallet/res/values-pt/strings-extra.xmlwallet/res/values-pt/strings.xmlwallet/res/values-ru/strings-dashpay.xmlwallet/res/values-ru/strings-extra.xmlwallet/res/values-ru/strings.xmlwallet/res/values-sk/strings-dashpay.xmlwallet/res/values-sk/strings-extra.xmlwallet/res/values-sk/strings.xmlwallet/res/values-tr/strings-dashpay.xmlwallet/res/values-uk/strings-dashpay.xmlwallet/res/values-uk/strings-extra.xmlwallet/res/values-uk/strings.xmlwallet/res/values-zh-rTW/strings-dashpay.xmlwallet/res/values-zh-rTW/strings-extra.xmlwallet/res/values-zh-rTW/strings.xmlwallet/res/values-zh/strings-dashpay.xmlwallet/res/values-zh/strings-extra.xmlwallet/res/values-zh/strings.xmlwallet/res/values/strings-dashpay.xmlwallet/res/values/strings-extra.xmlwallet/res/values/strings.xmlwallet/src/de/schildbach/wallet/WalletApplication.javawallet/src/de/schildbach/wallet/data/CoinJoinConfig.ktwallet/src/de/schildbach/wallet/database/entity/BlockchainIdentityData.ktwallet/src/de/schildbach/wallet/di/AppModule.ktwallet/src/de/schildbach/wallet/di/DashPayModule.ktwallet/src/de/schildbach/wallet/payments/MaxOutputAmountCoinJoinCoinSelector.ktwallet/src/de/schildbach/wallet/payments/SendCoinsTaskRunner.ktwallet/src/de/schildbach/wallet/service/BlockchainServiceImpl.ktwallet/src/de/schildbach/wallet/service/BlockchainStateDataProvider.ktwallet/src/de/schildbach/wallet/service/CoinJoinService.ktwallet/src/de/schildbach/wallet/service/ForegroundService.ktwallet/src/de/schildbach/wallet/service/WalletFactory.ktwallet/src/de/schildbach/wallet/service/WalletTransactionMetadataProvider.ktwallet/src/de/schildbach/wallet/service/platform/TopUpRepository.ktwallet/src/de/schildbach/wallet/service/platform/work/RestoreIdentityWorker.ktwallet/src/de/schildbach/wallet/service/platform/work/TopupIdentityWorker.ktwallet/src/de/schildbach/wallet/transactions/CSVExporter.ktwallet/src/de/schildbach/wallet/transactions/TransactionExporter.ktwallet/src/de/schildbach/wallet/transactions/WalletBalanceObserver.ktwallet/src/de/schildbach/wallet/ui/InviteHandlerViewModel.ktwallet/src/de/schildbach/wallet/ui/OnboardingViewModel.ktwallet/src/de/schildbach/wallet/ui/SettingsFragment.ktwallet/src/de/schildbach/wallet/ui/coinjoin/CoinJoinActivity.ktwallet/src/de/schildbach/wallet/ui/coinjoin/CoinJoinInfoFragment.ktwallet/src/de/schildbach/wallet/ui/coinjoin/CoinJoinLevelFragment.ktwallet/src/de/schildbach/wallet/ui/coinjoin/CoinJoinLevelViewModel.ktwallet/src/de/schildbach/wallet/ui/dashpay/CreateIdentityService.ktwallet/src/de/schildbach/wallet/ui/dashpay/CreateIdentityViewModel.ktwallet/src/de/schildbach/wallet/ui/dashpay/PlatformRepo.ktwallet/src/de/schildbach/wallet/ui/dashpay/utils/DashPayConfig.ktwallet/src/de/schildbach/wallet/ui/invite/CreateInviteViewModel.ktwallet/src/de/schildbach/wallet/ui/invite/InvitationFeeDialogFragment.ktwallet/src/de/schildbach/wallet/ui/main/MainActivity.ktwallet/src/de/schildbach/wallet/ui/main/MainActivityExt.ktwallet/src/de/schildbach/wallet/ui/main/MainViewModel.ktwallet/src/de/schildbach/wallet/ui/main/MixingStatusCard.ktwallet/src/de/schildbach/wallet/ui/main/WalletFragment.ktwallet/src/de/schildbach/wallet/ui/more/ConfirmInviteDialogFragment.ktwallet/src/de/schildbach/wallet/ui/more/MixDashFirstDialogFragment.ktwallet/src/de/schildbach/wallet/ui/more/MixDashFirstViewModel.ktwallet/src/de/schildbach/wallet/ui/more/MoreFragment.ktwallet/src/de/schildbach/wallet/ui/more/SettingsScreen.ktwallet/src/de/schildbach/wallet/ui/more/SettingsViewModel.ktwallet/src/de/schildbach/wallet/ui/send/SendCoinsFragment.ktwallet/src/de/schildbach/wallet/ui/send/SendCoinsViewModel.ktwallet/src/de/schildbach/wallet/ui/username/request/RequestUserNameViewModel.ktwallet/src/de/schildbach/wallet/ui/username/request/RequestUsernameFragment.ktwallet/test/de/schildbach/wallet/payments/SendCoinsTaskRunnerBIP70Test.ktwallet/test/de/schildbach/wallet/service/WalletTransactionMetadataProviderGiftCardTest.ktwallet/test/de/schildbach/wallet/ui/dashpay/work/GetUsernameVotingResultOperationTest.ktwallet/test/de/schildbach/wallet/util/services/SendCoinsTaskRunnerTest.ktwallet/test/de/schildbach/wallet/util/viewModels/MainViewModelTest.kt
💤 Files with no reviewable changes (114)
- wallet/res/layout/fragment_coinjoin_level.xml
- common/src/main/res/values-it/strings.xml
- wallet/src/de/schildbach/wallet/ui/coinjoin/CoinJoinInfoFragment.kt
- common/src/main/res/values-ja/strings.xml
- wallet/res/layout/fragment_coinjoin_info.xml
- wallet/res/layout/home_content.xml
- wallet/res/layout/activity_coinjoin.xml
- wallet/src/de/schildbach/wallet/payments/MaxOutputAmountCoinJoinCoinSelector.kt
- common/src/main/res/values-ko/strings.xml
- common/src/main/res/values-el/strings.xml
- wallet/src/de/schildbach/wallet/ui/more/MixDashFirstDialogFragment.kt
- common/src/main/res/values-id/strings.xml
- wallet/src/de/schildbach/wallet/ui/more/MixDashFirstViewModel.kt
- wallet/src/de/schildbach/wallet/ui/username/request/RequestUsernameFragment.kt
- wallet/res/layout/fragment_request_username.xml
- common/src/main/res/values-fil/strings.xml
- common/src/main/res/values-pl/strings.xml
- wallet/res/layout/dialog_mix_dash_first.xml
- wallet/src/de/schildbach/wallet/data/CoinJoinConfig.kt
- wallet/res/values-zh/strings.xml
- wallet/res/values-fa/strings-extra.xml
- wallet/res/values-el/strings-extra.xml
- common/src/main/java/org/dash/wallet/common/WalletDataProvider.kt
- common/src/main/res/values-nl/strings.xml
- common/src/main/res/values-fa/strings.xml
- wallet/src/de/schildbach/wallet/ui/send/SendCoinsFragment.kt
- wallet/AndroidManifest.xml
- common/src/main/res/values-uk/strings.xml
- wallet/res/values-it/strings.xml
- wallet/res/values-id/strings-extra.xml
- common/src/main/res/values-sk/strings.xml
- common/src/main/res/values-pt/strings.xml
- common/src/main/res/values-zh-rTW/strings.xml
- wallet/src/de/schildbach/wallet/di/DashPayModule.kt
- wallet/src/de/schildbach/wallet/ui/main/MixingStatusCard.kt
- wallet/res/values-ja/strings-extra.xml
- common/src/main/res/values-es/strings.xml
- wallet/res/values-ko/strings.xml
- wallet/src/de/schildbach/wallet/ui/dashpay/utils/DashPayConfig.kt
- wallet/res/values-pl/strings-extra.xml
- wallet/res/values-uk/strings-extra.xml
- wallet/src/de/schildbach/wallet/ui/main/WalletFragment.kt
- wallet/res/values-pt/strings-extra.xml
- wallet/res/values-fil/strings.xml
- wallet/res/values-sk/strings.xml
- features/exploredash/src/main/java/org/dash/wallet/features/exploredash/network/service/stubs/FakeDashSpendService.kt
- wallet/res/values-id/strings.xml
- wallet/res/values-es/strings-extra.xml
- wallet/res/values-tr/strings-dashpay.xml
- wallet/src/de/schildbach/wallet/service/platform/work/TopupIdentityWorker.kt
- wallet/src/de/schildbach/wallet/ui/SettingsFragment.kt
- wallet/res/values-fr/strings-extra.xml
- wallet/res/values-el/strings.xml
- wallet/res/values-it/strings-extra.xml
- wallet/res/values-zh-rTW/strings.xml
- wallet/src/de/schildbach/wallet/ui/dashpay/PlatformRepo.kt
- common/src/main/res/values-de/strings.xml
- wallet/src/de/schildbach/wallet/ui/coinjoin/CoinJoinLevelViewModel.kt
- common/src/main/res/values/strings.xml
- wallet/res/values-pt/strings.xml
- common/src/main/res/values-ru/strings.xml
- wallet/res/navigation/nav_coinjoin.xml
- wallet/src/de/schildbach/wallet/service/CoinJoinService.kt
- wallet/res/values-ru/strings-extra.xml
- wallet/res/values-sk/strings-extra.xml
- wallet/res/values-es/strings.xml
- wallet/src/de/schildbach/wallet/service/platform/work/RestoreIdentityWorker.kt
- wallet/res/values-fa/strings.xml
- wallet/src/de/schildbach/wallet/ui/coinjoin/CoinJoinLevelFragment.kt
- wallet/res/values-pl/strings.xml
- wallet/androidTest/de/schildbach/wallet/security/SecurityGuardMultiThreadingTest.kt
- wallet/res/values-de/strings-extra.xml
- wallet/src/de/schildbach/wallet/ui/coinjoin/CoinJoinActivity.kt
- wallet/res/values-ko/strings-extra.xml
- wallet/res/values/strings-extra.xml
- wallet/res/values-nl/strings.xml
- wallet/res/values-uk/strings.xml
- wallet/res/values-zh-rTW/strings-extra.xml
- wallet/src/de/schildbach/wallet/database/entity/BlockchainIdentityData.kt
- common/src/main/res/values-fr/strings.xml
- wallet/res/values-fil/strings-extra.xml
- common/src/main/res/values-zh/strings.xml
- common/src/main/java/org/dash/wallet/common/data/WalletUIConfig.kt
- wallet/res/values-nl/strings-dashpay.xml
- wallet/src/de/schildbach/wallet/transactions/WalletBalanceObserver.kt
- common/src/main/java/org/dash/wallet/common/services/analytics/AnalyticsConstants.kt
- common/src/main/java/org/dash/wallet/common/services/SendPaymentService.kt
- wallet/res/values-fa/strings-dashpay.xml
- wallet/res/values-zh/strings-dashpay.xml
- wallet/res/values-zh-rTW/strings-dashpay.xml
- wallet/res/values-fr/strings.xml
- wallet/res/values-nl/strings-extra.xml
- wallet/src/de/schildbach/wallet/ui/dashpay/CreateIdentityViewModel.kt
- wallet/res/values-ko/strings-dashpay.xml
- wallet/res/values-fil/strings-dashpay.xml
- wallet/res/values-el/strings-dashpay.xml
- wallet/res/values-es/strings-dashpay.xml
- wallet/res/values-ja/strings.xml
- wallet/res/values-uk/strings-dashpay.xml
- wallet/res/values-zh/strings-extra.xml
- wallet/res/values-id/strings-dashpay.xml
- wallet/test/de/schildbach/wallet/payments/SendCoinsTaskRunnerBIP70Test.kt
- wallet/res/values-pt/strings-dashpay.xml
- wallet/res/values-de/strings.xml
- wallet/res/values-ru/strings.xml
- wallet/src/de/schildbach/wallet/ui/more/SettingsViewModel.kt
- wallet/res/values-fr/strings-dashpay.xml
- wallet/res/values-it/strings-dashpay.xml
- wallet/res/values-sk/strings-dashpay.xml
- wallet/res/values-ja/strings-dashpay.xml
- wallet/res/values-ru/strings-dashpay.xml
- wallet/res/values-de/strings-dashpay.xml
- wallet/res/values/strings-dashpay.xml
- wallet/res/values-pl/strings-dashpay.xml
| ): AssetLockTransaction { | ||
| Context.propagate(walletDataProvider.wallet!!.context) | ||
| val balance = walletDataProvider.wallet!!.getBalance(Wallet.BalanceType.ESTIMATED_SPENDABLE) | ||
| val emptyWallet = balance == topupAmount && balance <= (topupAmount + Transaction.MIN_NONDUST_OUTPUT) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Fix logical error in empty-wallet dust calculations.
Using == with && in the emptyWallet condition means it will only evaluate to true if balance is exactly equal to topupAmount. It will incorrectly return false if the wallet has a small dust remainder (e.g., when balance is slightly greater than topupAmount but less than the dust threshold). Use >= to properly check if the remaining change falls in the dust range.
wallet/src/de/schildbach/wallet/service/platform/TopUpRepository.kt#L207-L207: Update toval emptyWallet = balance >= topupAmount && balance <= (topupAmount + Transaction.MIN_NONDUST_OUTPUT)wallet/src/de/schildbach/wallet/service/platform/TopUpRepository.kt#L564-L564: Update toval emptyWallet = balance >= topupAmount && balance <= (topupAmount + Transaction.MIN_NONDUST_OUTPUT)
📍 Affects 1 file
wallet/src/de/schildbach/wallet/service/platform/TopUpRepository.kt#L207-L207(this comment)wallet/src/de/schildbach/wallet/service/platform/TopUpRepository.kt#L564-L564
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@wallet/src/de/schildbach/wallet/service/platform/TopUpRepository.kt` at line
207, Update both emptyWallet calculations in
wallet/src/de/schildbach/wallet/service/platform/TopUpRepository.kt at lines
207-207 and 564-564 to use balance >= topupAmount while retaining the upper
dust-threshold check. Apply the same condition consistently at both sites.
| private fun MainActivity.showTimeSkewAlertDialog(diffSeconds: Long) { | ||
| val settingsIntent = Intent(Settings.ACTION_DATE_SETTINGS) | ||
| val hasSettings = packageManager.resolveActivity(settingsIntent, 0) != null | ||
|
|
||
| AdaptiveDialog.create( | ||
| R.drawable.ic_warning, | ||
| getString(R.string.wallet_timeskew_dialog_title), | ||
| if (coinJoin) { | ||
| val position = getString(if (diffSeconds > 0) R.string.timeskew_ahead else R.string.timeskew_behind) | ||
| getString(R.string.wallet_coinjoin_timeskew_dialog_msg, position, abs(diffSeconds)) | ||
| } else { | ||
| getString(R.string.wallet_timeskew_dialog_msg, diffSeconds / 1000) | ||
| }, | ||
| getString(R.string.wallet_timeskew_dialog_msg, diffSeconds / 60), |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Check the time skew dialog message string.
rg 'wallet_timeskew_dialog_msg' wallet/res/values/strings.xmlRepository: dashpay/dash-wallet
Length of output: 397
🏁 Script executed:
#!/bin/bash
set -euo pipefail
file="wallet/src/de/schildbach/wallet/ui/main/MainActivityExt.kt"
echo "== imports =="
sed -n '1,60p' "$file"
echo
echo "== dialog section =="
sed -n '270,300p' "$file"Repository: dashpay/dash-wallet
Length of output: 3904
Use the absolute minute count here. wallet_timeskew_dialog_msg expects “%d minutes”, so diffSeconds / 60 can render a negative value when the device clock is behind. Restore kotlin.math.abs and wrap the argument in abs(...).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@wallet/src/de/schildbach/wallet/ui/main/MainActivityExt.kt` around lines 282
- 289, Update MainActivity.showTimeSkewAlertDialog to pass the absolute minute
difference to wallet_timeskew_dialog_msg by restoring kotlin.math.abs and
wrapping diffSeconds / 60 with abs(...), ensuring the displayed minute count is
non-negative.
| val application = mockk<WalletApplication>() | ||
|
|
||
| val sendCoinsTaskRunner = SendCoinsTaskRunner(application, mockk(), mockk(), mockk(), mockk(), mockk(), coinJoinConfig, coinJoinService, mockk(), mockk(), mockk()) | ||
| val sendCoinsTaskRunner = SendCoinsTaskRunner(application, mockk(), mockk(), mockk(), mockk(), mockk(), mockk(), mockk(), mockk()) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win
Fix both SendCoinsTaskRunner constructor calls.
The constructor requires WalletDataProvider followed by WalletApplication.
wallet/test/de/schildbach/wallet/util/services/SendCoinsTaskRunnerTest.kt#L46-L46: moveapplicationto the second argument.wallet/test/de/schildbach/wallet/util/services/SendCoinsTaskRunnerTest.kt#L64-L64: apply the same argument-order correction.
📍 Affects 1 file
wallet/test/de/schildbach/wallet/util/services/SendCoinsTaskRunnerTest.kt#L46-L46(this comment)wallet/test/de/schildbach/wallet/util/services/SendCoinsTaskRunnerTest.kt#L64-L64
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@wallet/test/de/schildbach/wallet/util/services/SendCoinsTaskRunnerTest.kt` at
line 46, Correct both SendCoinsTaskRunner constructor calls in
wallet/test/de/schildbach/wallet/util/services/SendCoinsTaskRunnerTest.kt at
lines 46-46 and 64-64 by passing the WalletDataProvider mock as the first
argument and application (WalletApplication) as the second argument.
…placement for CoinJoin) Co-Authored-By: Claude Fable 5 <[email protected]>
- gift-card metadata cache wrote the partially-populated incoming card instead of the merged one, erasing stored fields; also merge redeemUrlChallenge like other fields - CSV export crashed with uninitialized metadataMap unless callers remembered initMetadataMap(); exportString() now self-initializes - GetUsernameVotingResultOperationTest assumed a 2-minute buffer; production DELAY_AFTER_VOTING_PERIOD is 1 minute - gift-card test updated for the insertGiftCardData signature added by the redeem-url change (order/giftCardChallenge/index) Co-Authored-By: Claude Fable 5 <[email protected]>
CoinJoin removal (Phase 2 of the Kotlin SDK migration plan): - delete the mixing engine wiring (CoinJoinService, CoinJoinConfig, DI binding), all mixing UI (CoinJoinActivity/info/level screens, MixingStatusCard, MixDashFirst dialog, settings row), mixing notification/foreground-service promotion, coinjoin coin selectors, analytics events, and all related strings/drawables/layouts/nav across every locale - previously mixed funds STAY SPENDABLE: the wallet still loads as WalletEx and the CoinJoin keychain is still provisioned on load/create/restore/upgrade, so legacy mixed UTXOs remain visible and are selected by the standard ZeroConfCoinSelector; historical mixing transactions keep grouped display - send flow always uses the standard selectors; useCoinJoin threading removed from identity/invite/top-up funding (dashj still receives useCoinJoin=false) - fix latent time-skew dialog bug exposed by removing the coinjoin branch (seconds were divided by 1000 again and shown as minutes) Start of Phase 1 (dashj seam neutralization in common): - new neutral SyncStage enum; BlockchainStateProvider no longer exposes PeerGroup.SyncStage or AbstractBlockChain - remove dead SendPaymentService.isFeeTooHigh (no callers, always false) - consolidate observeSpendableBalance into observeTotalBalance (identical streams after mixing removal) Verified: assemble_testNet3Debug and the full wallet unit-test suite pass. Co-Authored-By: Claude Fable 5 <[email protected]>
d44b6a5 to
9c9342d
Compare
|
Closing as superseded by #1532. The CoinJoin removal this PR performs is already contained in the Phase 1 cutover branch (
Any remaining cleanup or refactoring will be handled in Phase 1B / 2 / 3 (#1520, #1521, #1522). |
This is PR A of a staged migration series (B: Kotlin SDK integration — blocked on dashpay/platform#4045; C: shielded-balance UX; D: send-path cutover). It removes CoinJoin mixing from the wallet while guaranteeing that funds users previously mixed remain fully spendable and correctly displayed.
What was removed
CoinJoinService,CoinJoinConfig, the DI binding, and all mixing session wiringMixingStatusCard, the MixDashFirst dialog, the settings row, and the mixing notification / foreground-service promotionuseCoinJointhreading removed from identity/invite/top-up funding (dashj still receivesuseCoinJoin=false)Net: 156 files changed, +390 / −3,760 lines.
What was deliberately kept
WalletEx, and the CoinJoin keychain is still provisioned on load/create/restore/upgrade. Historical mixed UTXOs therefore remain visible, are counted in the balance, and are selected by the standardZeroConfCoinSelector— previously-mixed funds stay spendable.Also in this slice
SyncStageenum (BlockchainStateProvider no longer exposesPeerGroup.SyncStage/AbstractBlockChain), removal of deadSendPaymentService.isFeeTooHigh, and consolidation ofobserveSpendableBalanceintoobserveTotalBalance(identical streams once mixing is gone)docs/kotlin-sdk-migration-plan.md)Test evidence
:wallet:test_testNet3DebugUnitTestgreen at this commit (re-verified against the current toolchain: 61 tests, 0 failures), and:wallet:compile_testNet3DebugKotlin/assemble_testNet3Debugbuild clean🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Changes