Skip to content

Prepare 11.2.2 #1393

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

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

Prepare 11.2.2 #1393

wants to merge 14 commits into from

Conversation

HashEngineering
Copy link
Collaborator

@HashEngineering HashEngineering commented May 15, 2025

Issue being fixed or feature implemented

Related PR's and Dependencies

Screenshots / Videos

How Has This Been Tested?

  • QA (Mobile Team)

Checklist:

  • I have performed a self-review of my own code and added comments where necessary
  • I have added or updated relevant unit/integration/functional/e2e tests

Summary by CodeRabbit

  • New Features

    • Added new and updated localized strings for CoinJoin transaction statuses, block explorer selection, copyright notices, and account management in multiple languages.
    • Expanded UI text for gift card options, filtering, and status messages in several localizations.
  • Bug Fixes

    • Improved localization by correcting or updating the translation for the "Discount" sort option in various languages.
    • Added exception handling to prevent crashes during time skew updates on system time changes.
  • Chores

    • Updated dependency versions and Explore database file paths to new versions.
    • Cleaned up resource files by removing unnecessary blank lines.
  • Refactor

    • Enhanced fiat amount formatting for gift card purchases.
    • Adjusted dust threshold logic and improved coroutine support for asset lock transactions.
    • Streamlined initialization flow in staking activity.
    • Updated coroutine scope usage in payment receive fragment.
    • Set explicit min and max amounts in receive fragment input.

@HashEngineering HashEngineering self-assigned this May 15, 2025
Copy link
Contributor

coderabbitai bot commented May 15, 2025

Walkthrough

This update revises dependency versions by removing snapshot suffixes, updates database file references to version 3, refines fiat amount formatting for gift card purchases, converts a repository method to a suspend function with flow-based balance retrieval, and adjusts coroutine usage in activity initialization. It also enhances localization by adding new strings, translating "Discount" in multiple languages, and cleaning up whitespace in resource files. New CoinJoin and copyright strings are added in several locales.

Changes

File(s) Change Summary
build.gradle Removed "-SNAPSHOT" suffixes from dashjVersion and dppVersion dependency versions.
fastlane/Fastfile
wallet/src/de/schildbach/wallet/Constants.java
Updated Explore database file paths from "explore-v2" to "explore-v3" for production, testnet, and devnet flavors.
features/exploredash/src/main/java/org/dash/wallet/features/exploredash/ui/ctxspend/CTXSpendViewModel.kt Changed fiat amount formatting for gift card purchases to use MonetaryFormat.FIAT.noCode().format(amountValue) instead of raw numeric conversion.
wallet/src/de/schildbach/wallet/service/platform/TopUpRepository.kt Converted createAssetLockTransaction to a suspend function; updated balance retrieval to use flow-based asynchronous call; introduced MIN_DUST_FACTOR constant to adjust dust threshold logic.
wallet/src/de/schildbach/wallet/ui/staking/StakingActivity.kt Moved observation of online account status inside coroutine after navigation graph setup.
wallet/src/de/schildbach/wallet/service/CoinJoinService.kt Added exception handling around time skew update in BroadcastReceiver for time changes.
wallet/src/de/schildbach/wallet/ui/payments/PaymentsReceiveFragment.kt Changed coroutine scope from lifecycleScope to viewLifecycleOwner.lifecycleScope in onViewCreated.
wallet/src/de/schildbach/wallet/ui/payments/ReceiveFragment.kt Added calls to set max and min amounts to zero in enterAmountViewModel.
features/exploredash/src/main/res/values-*/strings-explore-dash.xml Added new localization strings for gift card filters, login flows, and UI prompts; replaced English "Discount" with localized equivalents in sort options; removed extraneous blank lines across many language resource files.
wallet/res/values-/strings-dashpay.xml
wallet/res/values-
/strings-extra.xml
wallet/res/values-*/strings.xml
Added new CoinJoin mixing finishing status strings and block explorer selection titles; added copyright notices for 2025 in multiple languages; no existing strings were removed or modified beyond additions.

Sequence Diagram(s)

sequenceDiagram
    participant UI as StakingActivity
    participant VM as StakingViewModel
    participant Nav as NavController

    UI->>UI: onCreate()
    UI->>UI: lifecycleScope.launch
    activate UI
    UI->>Nav: setNavigationGraph()
    UI->>VM: observeOnlineAccountStatus()
    VM-->>UI: handleOnlineAccountStatus()
    deactivate UI
Loading
sequenceDiagram
    participant TopUpRepo as TopUpRepositoryImpl
    participant WalletData as WalletDataProvider

    TopUpRepo->>WalletData: observeSpendableBalance().first()
    WalletData-->>TopUpRepo: Balance
    TopUpRepo->>TopUpRepo: Calculate emptyWallet using MIN_DUST_FACTOR
    TopUpRepo->>TopUpRepo: Create Asset Lock Transaction
Loading

Poem

In every tongue, a bunny hops,
Translating "Discount" as it stops.
New coins to mix, new dust to sweep,
Database v3—no secrets to keep!
Strings and coroutines, all aligned,
A rabbit’s work, both swift and kind.
🐇✨

Note

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback.
Learn more here.


Note

⚡️ Faster reviews with caching

CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.
Enjoy the performance boost—your workflow just got faster.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 3d3c871 and 57f703c.

📒 Files selected for processing (2)
  • wallet/src/de/schildbach/wallet/ui/payments/PaymentsReceiveFragment.kt (1 hunks)
  • wallet/src/de/schildbach/wallet/ui/payments/ReceiveFragment.kt (2 hunks)
🔇 Additional comments (3)
wallet/src/de/schildbach/wallet/ui/payments/PaymentsReceiveFragment.kt (1)

101-101: Improved coroutine lifecycle management

The change from lifecycleScope.launch to viewLifecycleOwner.lifecycleScope.launch is a best practice that properly ties the coroutine's lifecycle to the fragment's view lifecycle instead of the fragment itself. This prevents potential memory leaks and crashes that could occur if the view is destroyed while the coroutine is still active.

wallet/src/de/schildbach/wallet/ui/payments/ReceiveFragment.kt (2)

31-31: Added import for Coin class

The import of org.bitcoinj.core.Coin is appropriately added to support the newly introduced Coin.ZERO constants in the file.


68-69:

✅ Verification successful

Verify the intended behavior of setting both min and max amounts to zero

Setting both minimum and maximum amounts to zero could potentially restrict the user from entering any value. Please verify that this is the intended behavior and that it doesn't prevent users from specifying an amount to receive.


🏁 Script executed:

#!/bin/bash
# Check how EnterAmountViewModel handles zero min/max values and look for any special handling
rg -A 10 "setMaxAmount|setMinAmount" --type kotlin

Length of output: 22343


🏁 Script executed:

#!/bin/bash
# Display EnterAmountViewModel implementation for min/max handling and input validation
sed -n '1,200p' common/src/main/java/org/dash/wallet/common/ui/enter_amount/EnterAmountViewModel.kt
echo "-----"
sed -n '200,400p' common/src/main/java/org/dash/wallet/common/ui/enter_amount/EnterAmountViewModel.kt

Length of output: 4907


No upper bound enforced; zero min requires positive input

According to EnterAmountViewModel.canContinue(),

  • maxAmount == Coin.ZERO is treated as “no maximum” (the max check is skipped), and
  • minAmount == Coin.ZERO (with isIncludedMin=false) enforces amount > 0

This matches the intended behavior on ReceiveFragment: users can enter any positive amount without an upper limit. No changes required.

✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

fiatAmount = amountValue.toBigDecimal().toDouble().toString(),
fiatAmount = MonetaryFormat.FIAT.noCode().format(amountValue).toString(),
Copy link
Collaborator Author

@HashEngineering HashEngineering May 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we had a fiat value of 0.00999981 that should be 0.01

amountValue.toBigDecimal().toDouble().toString() would give "0.00999981". CTX would truncate that to 0.00

MonetaryFormat.FIAT.noCode().format(amountValue).toString() will give 0.01

@@ -124,7 +123,6 @@
<string-array name="sort_by_options_names">
<item>اسم</item>
<item>مسافة</item>
<item>Discount</item>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops, tx overwrote the these changes.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

🧹 Nitpick comments (6)
wallet/res/values-es/strings-extra.xml (1)

297-297: Trim trailing whitespace in Spanish copyright string
There’s an extra space before the closing </string> tag. Removing it ensures consistency and prevents unintended rendering artifacts.

-    <string name="about_copyright">Copyright © 2025 Grupo Dash Core </string>
+    <string name="about_copyright">Copyright © 2025 Grupo Dash Core</string>
wallet/res/values-es/strings.xml (1)

181-181: Trim trailing whitespace in Spanish CoinJoin dust string
There’s an extra space before the closing </string> tag. Removing it prevents unintended UI gaps.

-    <string name="transaction_row_status_coinjoin_combine_dust">Polvo combinado CoinJoin </string>
+    <string name="transaction_row_status_coinjoin_combine_dust">Polvo combinado CoinJoin</string>
wallet/src/de/schildbach/wallet/Constants.java (1)

96-96: Extract common logic for DB file path
The three calls setting EXPLORE_GC_FILE_PATH repeat the same pattern. Consider introducing a single version constant and composing the path using FILENAME_NETWORK_SUFFIX to reduce duplication:

 static {
+    // DRY: single version for all flavors
+    final String exploreGcVersion = "explore-v3";
     switch (BuildConfig.FLAVOR) {
         case "prod": {
-            org.dash.wallet.common.util.Constants.INSTANCE.setEXPLORE_GC_FILE_PATH("explore/explore-v3.db");
+            org.dash.wallet.common.util.Constants.INSTANCE.setEXPLORE_GC_FILE_PATH(
+                "explore/" + exploreGcVersion + FILENAME_NETWORK_SUFFIX + ".db");
             break;
         }
         case "staging":
         case "_testNet3": {
-            org.dash.wallet.common.util.Constants.INSTANCE.setEXPLORE_GC_FILE_PATH("explore/explore-v3-testnet.db");
+            org.dash.wallet.common.util.Constants.INSTANCE.setEXPLORE_GC_FILE_PATH(
+                "explore/" + exploreGcVersion + FILENAME_NETWORK_SUFFIX + ".db");
             break;
         }
         case "devnet": {
-            org.dash.wallet.common.util.Constants.INSTANCE.setEXPLORE_GC_FILE_PATH("explore/explore-v3-devnet.db");
+            org.dash.wallet.common.util.Constants.INSTANCE.setEXPLORE_GC_FILE_PATH(
+                "explore/" + exploreGcVersion + FILENAME_NETWORK_SUFFIX + ".db");
             break;
         }

Also applies to: 124-124, 144-144

features/exploredash/src/main/res/values-es/strings-explore-dash.xml (1)

66-66: Review Spanish for savings string
The choice “Salvar %.2f%%” may not clearly convey “you save X%” in Spanish. Consider a more idiomatic phrase such as:

-    <string name="explore_pay_with_dash_save">Salvar %.2f%%</string>
+    <string name="explore_pay_with_dash_save">Ahorra %.2f%%</string>
features/exploredash/src/main/res/values-zh/strings-explore-dash.xml (2)

2-15: Verify license header placement and update year
The GPL header has been added directly after the XML declaration. Please confirm that resource XML files in this project should include the full license block. Additionally, consider updating the copyright year to the current release.


221-226: Use full-width punctuation in Chinese translations
In the new strings—particularly “一旦生成代码, 它将显示在此处.”—please replace ASCII commas and periods with their Chinese counterparts ( and ) to adhere to typographic conventions:

- 一旦生成代码, 它将显示在此处.
+ 一旦生成代码,它将显示在此处。
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 6e22af3 and 9222802.

📒 Files selected for processing (43)
  • build.gradle (1 hunks)
  • fastlane/Fastfile (1 hunks)
  • features/exploredash/src/main/java/org/dash/wallet/features/exploredash/ui/ctxspend/CTXSpendViewModel.kt (1 hunks)
  • features/exploredash/src/main/res/values-ar/strings-explore-dash.xml (0 hunks)
  • features/exploredash/src/main/res/values-cs/strings-explore-dash.xml (0 hunks)
  • features/exploredash/src/main/res/values-de/strings-explore-dash.xml (1 hunks)
  • features/exploredash/src/main/res/values-el/strings-explore-dash.xml (1 hunks)
  • features/exploredash/src/main/res/values-es/strings-explore-dash.xml (4 hunks)
  • features/exploredash/src/main/res/values-fa/strings-explore-dash.xml (1 hunks)
  • features/exploredash/src/main/res/values-fil/strings-explore-dash.xml (1 hunks)
  • features/exploredash/src/main/res/values-fr/strings-explore-dash.xml (1 hunks)
  • features/exploredash/src/main/res/values-id/strings-explore-dash.xml (1 hunks)
  • features/exploredash/src/main/res/values-it/strings-explore-dash.xml (4 hunks)
  • features/exploredash/src/main/res/values-ja/strings-explore-dash.xml (1 hunks)
  • features/exploredash/src/main/res/values-ko/strings-explore-dash.xml (1 hunks)
  • features/exploredash/src/main/res/values-nl/strings-explore-dash.xml (1 hunks)
  • features/exploredash/src/main/res/values-pl/strings-explore-dash.xml (1 hunks)
  • features/exploredash/src/main/res/values-pt/strings-explore-dash.xml (1 hunks)
  • features/exploredash/src/main/res/values-ru/strings-explore-dash.xml (4 hunks)
  • features/exploredash/src/main/res/values-sk/strings-explore-dash.xml (1 hunks)
  • features/exploredash/src/main/res/values-th/strings-explore-dash.xml (0 hunks)
  • features/exploredash/src/main/res/values-tr/strings-explore-dash.xml (1 hunks)
  • features/exploredash/src/main/res/values-uk/strings-explore-dash.xml (4 hunks)
  • features/exploredash/src/main/res/values-zh-rTW/strings-explore-dash.xml (1 hunks)
  • features/exploredash/src/main/res/values-zh/strings-explore-dash.xml (4 hunks)
  • wallet/res/values-es/strings-dashpay.xml (1 hunks)
  • wallet/res/values-es/strings-extra.xml (1 hunks)
  • wallet/res/values-es/strings.xml (2 hunks)
  • wallet/res/values-pl/strings-dashpay.xml (1 hunks)
  • wallet/res/values-pl/strings-extra.xml (1 hunks)
  • wallet/res/values-pl/strings.xml (2 hunks)
  • wallet/res/values-pt/strings-dashpay.xml (1 hunks)
  • wallet/res/values-pt/strings-extra.xml (1 hunks)
  • wallet/res/values-pt/strings.xml (2 hunks)
  • wallet/res/values-uk/strings-dashpay.xml (1 hunks)
  • wallet/res/values-uk/strings-extra.xml (1 hunks)
  • wallet/res/values-uk/strings.xml (2 hunks)
  • wallet/res/values-zh/strings-dashpay.xml (1 hunks)
  • wallet/res/values-zh/strings-extra.xml (1 hunks)
  • wallet/res/values-zh/strings.xml (2 hunks)
  • wallet/src/de/schildbach/wallet/Constants.java (3 hunks)
  • wallet/src/de/schildbach/wallet/service/platform/TopUpRepository.kt (3 hunks)
  • wallet/src/de/schildbach/wallet/ui/staking/StakingActivity.kt (1 hunks)
💤 Files with no reviewable changes (3)
  • features/exploredash/src/main/res/values-th/strings-explore-dash.xml
  • features/exploredash/src/main/res/values-ar/strings-explore-dash.xml
  • features/exploredash/src/main/res/values-cs/strings-explore-dash.xml
🔇 Additional comments (62)
features/exploredash/src/main/res/values-zh-rTW/strings-explore-dash.xml (2)

2-16: Add GPL license header for this resource file
The inclusion of the GNU GPL header before the <resources> tag brings this file in line with the project’s licensing standards and matches other locale files. The comment block is well-formed and correctly placed.


116-116: Translate “Discount” into Taiwanese Chinese
The sort_by_options_names array now uses “折扣” for the “Discount” entry, which is consistent with the terminology in other locales.

wallet/res/values-uk/strings-extra.xml (1)

300-300: Add Ukrainian copyright notice for 2025
This new <string name="about_copyright"> entry correctly updates the year to 2025 and matches the pattern used in other locales.

wallet/res/values-zh/strings-dashpay.xml (1)

416-416: Add Chinese CoinJoin finishing status string
The new <string name="coinjoin_mixing_finishing">混币收尾</string> aligns with the introduced status in other locales and completes the CoinJoin UI messages.

wallet/res/values-zh/strings-extra.xml (1)

291-291: Add Chinese copyright notice for 2025
This mirrors other resource updates and consistently reflects the © 2025 Dash Core Group attribution.

wallet/res/values-uk/strings-dashpay.xml (1)

415-415: Add Ukrainian CoinJoin finishing status string
The string <string name="coinjoin_mixing_finishing">Змішування та фінішна обробка</string> correctly extends the CoinJoin status set in Ukrainian.

wallet/res/values-pl/strings-dashpay.xml (1)

415-415: Add Polish localization for CoinJoin finishing state
The new <string name="coinjoin_mixing_finishing">Kończenie Mieszania</string> aligns with other CoinJoin phase messages and follows naming and formatting conventions.

wallet/res/values-pt/strings-extra.xml (1)

297-297: Update Portuguese 'about' copyright notice
The addition of <string name="about_copyright">Copyright © 2025 Dash Core Group</string> correctly synchronizes the copyright year across languages.

wallet/res/values-es/strings-dashpay.xml (1)

416-416: Add Spanish localization for CoinJoin finishing state
The new <string name="coinjoin_mixing_finishing">Terminando mezclado</string> extends the CoinJoin UI status and matches the pattern in other languages.

wallet/res/values-pt/strings-dashpay.xml (1)

416-416: Add Portuguese localization for CoinJoin finishing state
The new <string name="coinjoin_mixing_finishing">Finalizando Mistura</string> correctly introduces the finishing phase label and is consistent with existing entries.

wallet/res/values-pl/strings-extra.xml (1)

300-300: Add 2025 copyright notice to Polish extra strings
This new <string> is consistent with other locales and correctly placed between the fork disclaimer and license entries.

wallet/res/values-pt/strings.xml (2)

181-181: Add CoinJoin “combine dust” status in Portuguese
The new transaction_row_status_coinjoin_combine_dust entry matches the key and is consistent with other locales.


419-420: Add block explorer selection title in Portuguese
The block_explorer_selection_title entry is correctly localized and aligns with updates in other languages.

wallet/res/values-pl/strings.xml (2)

181-181: Add CoinJoin “combine dust” status in Polish
The new transaction_row_status_coinjoin_combine_dust entry fits the existing transaction status section and follows localization conventions.


419-420: Add block explorer selection title in Polish
The block_explorer_selection_title key is correctly translated and placed with other preference entries.

wallet/res/values-es/strings.xml (1)

419-420: Add block explorer selection title in Spanish
The new block_explorer_selection_title entry is properly localized and consistent with other locale files.

wallet/res/values-uk/strings.xml (2)

185-185: Addition of CoinJoin dust-combine status string
The new transaction_row_status_coinjoin_combine_dust entry correctly provides the Ukrainian translation for the dust-combining status. It matches the key and format used in other locales.


423-423: Addition of block explorer selection title string
The block_explorer_selection_title string has been properly added with a clear Ukrainian translation. Ensure this key is referenced in the corresponding UI implementation.

wallet/res/values-zh/strings.xml (2)

181-181: Addition of CoinJoin dust-combine status string
The transaction_row_status_coinjoin_combine_dust key is correctly introduced with an accurate Chinese translation, consistent with other locales.


419-419: Addition of block explorer selection title string
The new block_explorer_selection_title entry is correctly added in Chinese. Verify that the UI layer references this string resource.

features/exploredash/src/main/res/values-tr/strings-explore-dash.xml (2)

2-7: Skip license header cleanup
Non-functional whitespace and comment adjustments in the license header; no impact on application behavior.


118-118: Approve Turkish translation of 'Discount'
Replaced the English term "Discount" with the correct Turkish translation "İndirim" to ensure localization consistency.

features/exploredash/src/main/res/values-pl/strings-explore-dash.xml (2)

2-7: Skip license header cleanup
Non-functional whitespace and comment adjustments in the license header; no impact on application behavior.


123-123: Approve Polish translation of 'Discount'
Replaced the English term "Discount" with the correct Polish translation "Zniżka" for consistency with other locales.

features/exploredash/src/main/res/values-fr/strings-explore-dash.xml (2)

2-7: Skip license header cleanup
Non-functional comment and whitespace adjustments; no behavioral changes.


121-121: Approve French translation of 'Discount'
Updated the sorting option to "Réduction," aligning with proper French localization.

build.gradle (1)

6-7:

❓ Verification inconclusive

Confirm dependency version stability
Removed the -SNAPSHOT suffix from dashjVersion and dppVersion, targeting stable releases (21.1.8 and 1.7.5). Ensure these versions are published and available on Maven Central before release.


🏁 Script executed:

#!/bin/bash
# Verify that dashj v21.1.8 and dpp v1.7.5 exist on Maven Central
for artifact in "org/dashj/dashj/21.1.8" "org/dashj/dpp/1.7.5"; do
  url="https://repo1.maven.org/maven2/$artifact/maven-metadata.xml"
  echo "Checking $url..."
  if ! curl -s --fail "$url" > /dev/null; then
    echo "Artifact $artifact not found on Maven Central" >&2
    exit 1
  fi
done
echo "All artifacts verified."

Length of output: 548


I’ll verify how dashjVersion and dppVersion are referenced in your Gradle files to determine the correct Maven coordinates.


🏁 Script executed:

#!/bin/bash
# Search for usage of dashjVersion and dppVersion to identify group and artifact IDs
rg -n "dashjVersion" -C 5 --glob "*.gradle"
rg -n "dppVersion" -C 5 --glob "*.gradle"

Length of output: 9203


Confirm Maven Central availability of stable DashJ & DPP artifacts

We’ve removed the -SNAPSHOT suffix and bumped to dashjVersion = '21.1.8' and dppVersion = '1.7.5'. Before shipping, please verify that these exact artifacts are published on Maven Central:

• org.dashj:dashj-core:21.1.8
• org.dashj.platform:dash-sdk-java:1.7.5
• org.dashj.platform:dash-sdk-kotlin:1.7.5
• org.dashj.platform:dash-sdk-android:1.7.5

You can run:

#!/bin/bash
for artifact in \
  "org/dashj/dashj-core/21.1.8" \
  "org/dashj/platform/dash-sdk-java/1.7.5" \
  "org/dashj/platform/dash-sdk-kotlin/1.7.5" \
  "org/dashj/platform/dash-sdk-android/1.7.5"; do
  url="https://repo1.maven.org/maven2/$artifact/maven-metadata.xml"
  echo "Checking $url..."
  if ! curl -s --fail "$url" > /dev/null; then
    echo "ERROR: Artifact $artifact not found on Maven Central" >&2
    exit 1
  fi
done
echo "✔ All artifacts verified on Maven Central."
features/exploredash/src/main/res/values-de/strings-explore-dash.xml (2)

2-7: Skip license header cleanup
Header formatting changes only; no functional impact.


119-119: Approve German translation of 'Discount'
Replaced the English term with "Rabatt" to ensure accurate localization.

features/exploredash/src/main/res/values-fa/strings-explore-dash.xml (1)

118-118: Approve localized 'Discount' translation.

The Persian string <item>تخفیف</item> correctly replaces the English term and aligns with other locale files.

features/exploredash/src/main/res/values-pt/strings-explore-dash.xml (1)

121-121: Approve localized 'Discount' translation.

The Portuguese string <item>Desconto</item> accurately translates “Discount” and matches the pattern used across other locales.

features/exploredash/src/main/res/values-id/strings-explore-dash.xml (1)

118-118: Approve localized 'Discount' translation.

The Indonesian string <item>Diskon</item> correctly localizes “Discount” and is consistent with the other resource files.

features/exploredash/src/main/res/values-el/strings-explore-dash.xml (1)

118-118: Approve localized 'Discount' translation.

The Greek string <item>Έκπτωση</item> properly replaces the English label and aligns with the translations in other languages.

features/exploredash/src/main/res/values-nl/strings-explore-dash.xml (1)

118-118: Approve localized 'Discount' translation.

The Dutch string <item>Korting</item> correctly translates “Discount” and follows the established localization updates.

features/exploredash/src/main/res/values-ja/strings-explore-dash.xml (1)

116-116: Localization improvement for "Discount" in Japanese sorting options.

The English word "Discount" has been properly translated to its Japanese equivalent "割引" in the sort_by_options_names string array.

features/exploredash/src/main/res/values-ko/strings-explore-dash.xml (1)

116-116: Localization improvement for "Discount" in Korean sorting options.

The English word "Discount" has been properly translated to its Korean equivalent "할인" in the sort_by_options_names string array.

features/exploredash/src/main/res/values-sk/strings-explore-dash.xml (1)

122-122: Localization improvement for "Discount" in Slovak sorting options.

The English word "Discount" has been properly translated to its Slovak equivalent "Zľava" in the sort_by_options_names string array.

wallet/src/de/schildbach/wallet/service/platform/TopUpRepository.kt (2)

48-48: Modernizing code with Flow API and coroutines.

The code has been updated to leverage Kotlin coroutines by making the createAssetLockTransaction method a suspend function and adding the necessary import for Flow.first().

Also applies to: 56-57, 95-95


101-115: Improved balance retrieval and dust threshold handling.

The changes include:

  1. Using Flow-based balance observation instead of direct wallet access
  2. Introducing MIN_DUST_FACTOR (10L) to increase the dust threshold
  3. Making the function suspend to support coroutine usage

These changes improve transaction safety by preventing the creation of outputs that might be considered dust by the network.

wallet/src/de/schildbach/wallet/ui/staking/StakingActivity.kt (1)

63-66: Good architectural improvement

Moving the observation of online account status into the coroutine scope is a good practice, as it consolidates initialization logic and better respects the activity's lifecycle. This change aligns with modern Android development patterns for asynchronous operations.

features/exploredash/src/main/java/org/dash/wallet/features/exploredash/ui/ctxspend/CTXSpendViewModel.kt (1)

129-129: Better string formatting approach

The change to use MonetaryFormat.FIAT.noCode().format(amountValue).toString() is an improvement over the previous approach. This provides more consistent formatting and avoids potential precision issues that could occur when converting between different numeric types.

fastlane/Fastfile (1)

176-176:

✅ Verification successful

Database version update

Updating to explore-v3.db aligns with corresponding database version updates in other parts of the codebase. Make sure all related code that interacts with this database is compatible with the new version.


🏁 Script executed:

#!/bin/bash
# Check for references to database versions in other files
echo "Checking database version references:"
rg -i "explore-v[0-9]" --type java --type kotlin --type xml

Length of output: 641


Database Version Aligned Across Codebase
All references to explore-v3 have been updated in wallet/src/de/schildbach/wallet/Constants.java (main, testnet, devnet). No further compatibility changes are needed.

features/exploredash/src/main/res/values-fil/strings-explore-dash.xml (1)

118-118: Localization improvement

Updating "Discount" to "Diskwento" improves the Filipino localization, making the UI more consistent for Filipino-speaking users.

wallet/src/de/schildbach/wallet/Constants.java (2)

124-124: Updated Explore GC DB path for testnet
The testnet Explore GC path now points to explore/explore-v3-testnet.db, matching the prod change with the network suffix.


144-144: Updated Explore GC DB path for devnet
The devnet Explore GC path has been updated to explore/explore-v3-devnet.db.

features/exploredash/src/main/res/values-ru/strings-explore-dash.xml (4)

93-95: New gift card filter labels
Added gift_card_types, flexible_amount_option, and fixed_denom_option to support the gift-card filter UI. Names match other locales.


127-127: Translated “Discount” into Russian
Replaced the English label in sort_by_options_names with the Russian equivalent Скидка.


216-217: New gift-card selection prompts
Added select_amount and select_fixed_amount strings for the purchase flow.


253-253: Temporarily unavailable label
Appended temporarily_unavailable for when CTX Spend is down.

features/exploredash/src/main/res/values-es/strings-explore-dash.xml (2)

121-121: Translated “Discount” into Spanish
Replaced the English label in sort_by_options_names with the Spanish equivalent Descuento.


237-239: Added DashSpend login and T&C localization
Introduced dashspend_create_account, login, dashspend_terms_conditions, view_terms_conditions, and barcode_placeholder for the DashSpend account flow.

Also applies to: 254-259

features/exploredash/src/main/res/values-uk/strings-explore-dash.xml (4)

68-68: New savings prompt
Added explore_pay_with_dash_save (Зберегти %.2f%%) to match other locales.


123-123: Translated “Discount” into Ukrainian
Replaced the English sort label with Знижка in sort_by_options_names.


233-238: DashSpend T&C & barcode placeholder
Added dashspend_terms_conditions, accept_terms_conditions, tap_link_to_proceed, accept_to_proceed, view_terms_conditions, and barcode_placeholder for DashSpend flows.


241-242: CTXSpend login localization
Added create_ctx_spend_account and log_in_to_ctxspend_account for the CTX Spend login flow.

features/exploredash/src/main/res/values-it/strings-explore-dash.xml (4)

91-93: New gift-card filter labels for Italian
Added gift_card_types, flexible_amount_option, and fixed_denom_option translations (Tipologie di gift card, Importi flessibili, Importi denominati in maniera fissa).


125-125: Translated “Discount” into Italian
Replaced English sort label with Sconto in sort_by_options_names.


212-213: Gift-card amount selection prompts
Added select_amount and select_fixed_amount keys for the purchase UI.


249-249: Temporarily unavailable message
Appended temporarily_unavailable (Temporaneamente non disponibile).

features/exploredash/src/main/res/values-zh/strings-explore-dash.xml (3)

62-62: New localized savings string is correct
The placeholder %.2f%% correctly escapes the percent sign. For consistency across translations—especially if more placeholders are added in the future—you may opt to use explicit positional indexing such as %1$.2f%%, though this is optional for single-argument strings.


115-118: Ensure sort-by dropdown consistency
You’ve introduced “折扣” as the third entry in the sort_by_options_names array. Verify that the corresponding index mapping and UI logic handle this new option, and ensure all other language versions of this array have been updated in parallel.


228-230: CTXSpend login string additions
The keys create_ctx_spend_account and log_in_to_ctxspend_account align with the CTXSpend feature. Please verify that the ViewModel and UI components reference these exact keys and that the translations match those in other locale files.

@@ -93,7 +93,7 @@ public final class Constants {
FILENAME_NETWORK_SUFFIX = "";
FEE_NETWORK_SUFFIX = FILENAME_NETWORK_SUFFIX;
WALLET_NAME_CURRENCY_CODE = "dash";
org.dash.wallet.common.util.Constants.INSTANCE.setEXPLORE_GC_FILE_PATH("explore/explore-v2.db");
org.dash.wallet.common.util.Constants.INSTANCE.setEXPLORE_GC_FILE_PATH("explore/explore-v3.db");
Copy link
Contributor

@coderabbitai coderabbitai bot May 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

❓ Verification inconclusive

Updated Explore GC DB path for production
The database filename has been bumped from v2 to v3 for the prod flavor. Ensure that the new explore/explore-v3.db asset is packaged in the build and available at runtime.


🏁 Script executed:

#!/bin/bash
# Verify the new explore-v3 DB files are present in the repository
fd --extension db "explore-v3"

Length of output: 30


🏁 Script executed:

#!/bin/bash
# Locate existing explore DB assets (v2)
fd explore-v2.db

# Verify presence of the new explore-v3 DB file
fd explore-v3.db

Length of output: 37


Missing explore-v3.db asset
We couldn’t locate the new explore/explore-v3.db file in the repo. Please add the explore-v3.db asset under your assets directory so it’s packaged into the build and available at runtime.

• Expected path (adjust if different):
wallet/src/main/assets/explore/explore-v3.db
• Confirm Gradle’s asset packaging includes this file

🤖 Prompt for AI Agents
In wallet/src/de/schildbach/wallet/Constants.java at line 96, the Explore GC DB
path was updated to "explore/explore-v3.db" but the corresponding explore-v3.db
asset file is missing from the repository. Add the explore-v3.db file under
wallet/src/main/assets/explore/ to ensure it is included in the build. Also
verify that the Gradle build configuration includes this asset directory so the
file is packaged and available at runtime.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file "explore/explore-v3.db" should not be in the assets folder, but is downloaded from Google Cloud

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧩 Analysis chain

@HashEngineering I understand now - the file isn't supposed to be in the repository. Let me check how the downloading mechanism works to provide better context.


🏁 Script executed:

#!/bin/bash
# Check the Fastfile to see how the explore database is downloaded
if [ -f fastlane/Fastfile ]; then
  grep -A 10 "explore_db" fastlane/Fastfile
fi

Length of output: 672


🏁 Script executed:

#!/bin/bash
# Get a more complete view of the explore_db lane in the Fastfile
if [ -f fastlane/Fastfile ]; then
  cat fastlane/Fastfile | grep -A 40 "lane :explore_db" 
fi

Length of output: 1342


@HashEngineering I see now - you're absolutely right. Looking at the Fastfile, I can confirm that explore-v3.db is downloaded from Google Cloud Storage during the build process via the explore_db lane. The file is pulled from the dash-wallet-firebase.appspot.com bucket and not stored in the repository.

The PR correctly updates both the filename reference in Constants.java and the filename to be downloaded in the Fastfile. Thanks for the clarification!


🧬 Code Graph Analysis Results

Relevant snippet from wallet/src/de/schildbach/wallet/Constants.java (lines 70-110 approx.)

static {
    // ...
    switch (BuildConfig.FLAVOR) {
        case "prod": {
            // ...
            org.dash.wallet.common.util.Constants.INSTANCE.setEXPLORE_GC_FILE_PATH("explore/explore-v3.db");
            // ...
            break;
        }
        case "staging":
        case "_testNet3": {
            // ...
            org.dash.wallet.common.util.Constants.INSTANCE.setEXPLORE_GC_FILE_PATH("explore/explore-v3-testnet.db");
            break;
        }
        case "devnet": {
            // ...
            org.dash.wallet.common.util.Constants.INSTANCE.setEXPLORE_GC_FILE_PATH("explore/explore-v3-devnet.db");
            break;
        }
        default: {
            throw new IllegalStateException("Unsupported flavor " + BuildConfig.FLAVOR);
        }
    }
    // ...
}

This snippet shows that the file path "explore/explore-v3.db" (and variants for testnet and devnet) is set programmatically via a call to org.dash.wallet.common.util.Constants.INSTANCE.setEXPLORE_GC_FILE_PATH(...) depending on the build flavor. This indicates that the database file is configured dynamically rather than being statically placed in the assets folder.


Relevant snippet summary from org.dash.wallet.common.util.Constants (implied from usage)

  • The class org.dash.wallet.common.util.Constants has a singleton instance INSTANCE.
  • It has a method setEXPLORE_GC_FILE_PATH(String path) which sets the path for the explore database file.
  • The path is set to "explore/explore-v3.db" for production flavor, and to other variants for testnet and devnet.
  • This suggests the explore database file is expected to be located or downloaded at the specified path, not bundled as an asset.

No other snippets explicitly mention the explore database file or its handling.

[End of relevant snippets.]

Comment on lines +204 to +206
<string name="dashspend_create_account">创建账户或登录现有账户</string>
<string name="create_new_account">创建新账户</string>
<string name="login">登录</string>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Review generic login string key
You’ve added dashspend_create_account and a generic login key. To avoid collisions with other modules, consider renaming login to a more specific identifier (e.g., dashspend_login) for clarity and to prevent inadvertent overrides.

🤖 Prompt for AI Agents
In features/exploredash/src/main/res/values-zh/strings-explore-dash.xml around
lines 204 to 206, rename the generic string key "login" to a more specific
identifier like "dashspend_login" to avoid key collisions with other modules.
Update the key in both the XML file and any code references to maintain
consistency and prevent inadvertent overrides.

Comment on lines -63 to -66
lifecycleScope.launch { navController = setNavigationGraph() }
lifecycleScope.launch {
navController = setNavigationGraph()
viewModel.observeOnlineAccountStatus().observe(this@StakingActivity, ::handleOnlineAccountStatus)
}

viewModel.navigationCallback.observe(this, ::handleNavigationRequest)
viewModel.observeOnlineAccountStatus().observe(this, ::handleOnlineAccountStatus)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there was a race condition. if the observer ran before the navController was initialized, then it would crash. This was a rare crash.

Comment on lines 111 to 114
val balance = walletDataProvider.wallet!!.getBalance(Wallet.BalanceType.ESTIMATED_SPENDABLE)
val emptyWallet = balance == fee && balance <= (fee + Transaction.MIN_NONDUST_OUTPUT)
val balance = walletDataProvider.observeSpendableBalance().first()
val emptyWallet = balance == fee && balance <= (fee + Transaction.MIN_NONDUST_OUTPUT.multiply(MIN_DUST_FACTOR))
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking at the wrong balance, which could cause username creation to stall and get stuck with Insufficent funds

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 1e41c55 and 3d3c871.

📒 Files selected for processing (2)
  • wallet/src/de/schildbach/wallet/service/CoinJoinService.kt (1 hunks)
  • wallet/src/de/schildbach/wallet/service/platform/TopUpRepository.kt (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • wallet/src/de/schildbach/wallet/service/platform/TopUpRepository.kt
🧰 Additional context used
🧬 Code Graph Analysis (1)
wallet/src/de/schildbach/wallet/service/CoinJoinService.kt (1)
wallet/src/de/schildbach/wallet/util/TimeUtils.kt (1)
  • getTimeSkew (50-103)
🪛 detekt (1.23.7)
wallet/src/de/schildbach/wallet/service/CoinJoinService.kt

[warning] 201-201: The caught exception is swallowed. The original exception could be lost.

(detekt.exceptions.SwallowedException)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build

Comment on lines +199 to +203
try {
updateTimeSkewInternal(getTimeSkew(force = true))
} catch (e: Exception) {
log.info("There was a problem obtaining the timeskew")
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Improve exception logging by including exception details

While adding exception handling around time skew updates is a good improvement for stability, the current implementation swallows the exception details, making troubleshooting difficult.

Enhance the logging by including the exception details:

try {
    updateTimeSkewInternal(getTimeSkew(force = true))
} catch (e: Exception) {
-    log.info("There was a problem obtaining the timeskew")
+    log.info("There was a problem obtaining the timeskew", e)
}

This will provide more context for debugging time skew issues while still preventing crashes.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
try {
updateTimeSkewInternal(getTimeSkew(force = true))
} catch (e: Exception) {
log.info("There was a problem obtaining the timeskew")
}
try {
updateTimeSkewInternal(getTimeSkew(force = true))
} catch (e: Exception) {
log.info("There was a problem obtaining the timeskew", e)
}
🧰 Tools
🪛 detekt (1.23.7)

[warning] 201-201: The caught exception is swallowed. The original exception could be lost.

(detekt.exceptions.SwallowedException)

🤖 Prompt for AI Agents
In wallet/src/de/schildbach/wallet/service/CoinJoinService.kt around lines 199
to 203, the catch block logs a generic message without including exception
details, which hinders debugging. Modify the log statement to include the caught
exception object so that the log captures the stack trace and message, providing
better context for troubleshooting time skew update failures.

Comment on lines +68 to +69
enterAmountViewModel.setMaxAmount(Coin.ZERO)
enterAmountViewModel.setMinAmount(Coin.ZERO)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the user goes to the Gift Card purchase flow, these limits will be set to match min/max of the card and the wallet balance and will limit what can be entered in the Receive screen. Therefore we need to reset the limits to zero which allows any number to be entered.

Not sure if there is a different way to clear the values with enterAmountViewModel by attaching it to a particular navigation graph. It needs to have a scope larger than a single fragment. With activityViewModels it stays alive while MainActivity is alive.

lifecycleScope.launch {
viewLifecycleOwner.lifecycleScope.launch {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was a crash when executing the lamba inside this launch.

Comment on lines -111 to +115
val balance = walletDataProvider.wallet!!.getBalance(Wallet.BalanceType.ESTIMATED_SPENDABLE)
val emptyWallet = balance == fee && balance <= (fee + Transaction.MIN_NONDUST_OUTPUT)
val balance = walletDataProvider.observeSpendableBalance().first()
val emptyWallet = balance == fee ||
(balance >= fee && balance <= (fee + Transaction.MIN_NONDUST_OUTPUT.multiply(MIN_DUST_FACTOR)))
Context.propagate(walletDataProvider.wallet!!.context)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a user has about 0.032 DASH and then mixes them to get just above 0.03 DASH, this code wouldn't set emptyWallet to true, then the username creation process would get stuck and report an insufficient funds exception in the logs. the only way to recover was to deposit more DASH and mix a bit more so that the fee could be covered.

Our goal is to empty the wallet if the username creation fee is just a bit higher than the requirement (0.03 in this case) to avoid such errors.

In this case, we were looking at the wrong balance (total) instead of spendable.

There still might be a way for this to fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant