Skip to content

Conversation

@HashEngineering
Copy link
Collaborator

@HashEngineering HashEngineering commented Jul 28, 2025

Summary by CodeRabbit

  • New Features

    • Introduced a command-line tool to display identity keys from a recovery phrase.
    • Added new test for fetching wallet utils data contract in Java SDK.
  • Bug Fixes

    • Updated header file paths in Java and C++ code for improved compatibility.
    • Reduced and updated the mainnet address list for network configuration.
  • Refactor

    • Migrated dependency versions to tagged releases for improved stability.
    • Updated build scripts to use JReleaser for streamlined publishing.
    • Improved platform version handling and SDK initialization logic.
    • Split FFI conversion traits for better modularity.
  • Documentation

    • Expanded and clarified Android library build and publishing instructions.
  • Chores

    • Upgraded Gradle and Rust toolchain versions.
    • Enhanced logging for profile creation and replacement.
  • Tests

    • Added and removed several test cases to align with updated platform features and types.
    • Removed obsolete or redundant test modules and functions.
  • Style

    • Updated deprecated Gradle properties for jar tasks.

@HashEngineering HashEngineering self-assigned this Jul 28, 2025
@coderabbitai
Copy link

coderabbitai bot commented Jul 28, 2025

Walkthrough

This update introduces broad dependency and build system upgrades across Android, Java, and Rust modules, including version bumps, migration to JReleaser for artifact publishing, and modernization of build scripts. It also refactors FFI and SDK initialization logic to support explicit platform versioning, adjusts test coverage, and adds new example and logging functionality.

Changes

Cohort / File(s) Change Summary
Build & Publishing Modernization
build.gradle, dash-sdk-android/build.gradle, dash-sdk-java/build.gradle, dpp/build.gradle, gradle/wrapper/gradle-wrapper.properties, README.md
Upgraded dependency and plugin versions, added JReleaser plugin and configuration, replaced manual Maven publishing with JReleaser deployment, updated Gradle and Android plugin versions, and expanded README publishing instructions.
Rust Dependency & Toolchain Updates
dash-sdk-android/src/main/rust/Cargo.toml, dash-sdk-android/src/main/rust/build.rs, dash-sdk-bindings/Cargo.toml, dash-sdk-bindings/build.rs, dash-sdk-bindings/rust-toolchain.toml, platform-mobile/Cargo.toml
Updated Rust crate versions, migrated dependencies from branches to tagged releases, refactored build scripts to use new ferment_sys API, and bumped Rust toolchain version.
FFI & SWIG Integration Adjustments
dash-sdk-java/src/main/cpp/context_provider.cpp, dash-sdk-java/src/main/cpp/conversions.h, dash-sdk-java/src/main/swig/root.i, dash-sdk-java/ignore.py, dash-sdk-java/src/main/swig/platform_value.i
Updated header include paths to new locations, commented out 128-bit integer constructors/getters in SWIG, and adjusted Python script for new header location.
Platform-Mobile SDK & FFI Refactor
platform-mobile/src/config.rs, platform-mobile/src/core.rs, platform-mobile/src/custom.rs, platform-mobile/src/data_contracts.rs, platform-mobile/src/fetch_identity.rs, platform-mobile/src/lib.rs, platform-mobile/src/provider.rs, platform-mobile/src/put.rs, platform-mobile/src/put_test.rs, platform-mobile/src/sdk.rs, platform-mobile/src/voting.rs
Introduced explicit platform versioning in SDK setup and FFI, refactored FFI trait implementations, updated method signatures, added logging, and removed the public tests module.
Platform-Mobile Test Module Removal
platform-mobile/src/tests/mod.rs, platform-mobile/src/tests/documents.rs
Deleted the entire test module and associated utility/test functions, removing exported test APIs and the documents submodule.
Java & Kotlin Test Adjustments
dash-sdk-java/src/test/java/org/dashj/platform/sdk/BaseTest.java, dash-sdk-java/src/test/java/org/dashj/platform/sdk/BinaryDataTest.java, dash-sdk-java/src/test/java/org/dashj/platform/sdk/DataContractTest.java, dash-sdk-java/src/test/java/org/dashj/platform/sdk/ValueTest.java, dpp/src/test/kotlin/org/dashj/platform/dapiclient/DapiGrpcClientTest.kt
Added new static test data, removed or commented out tests for binary data and platform value types, added a new data contract test, and enhanced transaction test with repeated retrievals and logging.
Android Manifest Adjustment
dash-sdk-android/src/main/AndroidManifest.xml
Removed the package attribute from the manifest.
DPP Platform Value Handling
dpp/src/main/java/org/dashj/platform/dpp/util/PlatformValueFunctions.kt
Commented out 128-bit integer handling in platform value conversion functions.
DPP Profiles Logging
dpp/src/main/java/org/dashj/platform/dashpay/Profiles.kt
Added logging of profile document JSON in create and replace methods.
Examples Addition
examples/src/main/kotlin/dashj/org/platform/DisplayIdentityKeys.kt
Added a new example class for displaying identity keys using a recovery phrase and client initialization.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI/Gradle
    participant JReleaser
    participant MavenCentral

    User->>CLI/Gradle: Initiate build and publish
    CLI/Gradle->>JReleaser: Run JReleaser tasks (deploy, release)
    JReleaser->>MavenCentral: Upload artifacts (staging/snapshot)
    MavenCentral-->>JReleaser: Confirm upload/release
    JReleaser-->>CLI/Gradle: Report status
    CLI/Gradle-->>User: Build and publish complete
Loading
sequenceDiagram
    participant App
    participant SDK
    participant PlatformVersion

    App->>SDK: Initialize with network and options
    SDK->>PlatformVersion: Select version (e.g., PLATFORM_V7/PLATFORM_V9)
    SDK->>SDK: Setup API with version parameter
    SDK-->>App: Ready for use
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐇
A carrot for each version bump,
New plugins hop into the clump.
Rust and Java, side by side,
With platform versions as our guide.
Out with the old, in with the new,
This bunny’s build is strong and true!
🥕✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch platform-2

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 generate unit tests to generate unit tests for 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.

Copy link

@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: 8

🔭 Outside diff range comments (1)
dpp/build.gradle (1)

158-198: Review JReleaser Sonatype endpoint and activation logic

The JReleaser URLs in your configuration are correct and up-to-date with the new Sonatype Central Publisher API (OSS RH EOL June 30, 2025). You’re already using:

  • https://central.sonatype.com/api/v1/publisher for bundle uploads
  • https://central.sonatype.com/repository/maven-snapshots/ for snapshots

Legacy OSSRH endpoints (e.g. s01.oss.sonatype.org) are now deprecated and will no longer accept uploads.

Please address the following in dpp/build.gradle (lines 158–198):

Signing scope

  • Currently:
    signing {
      active = 'ALWAYS'
      armored = true
    }
  • Suggestion: restrict signing to releases only, for example:
    signing {
      active  = project.version.endsWith('-SNAPSHOT') ? 'NEVER' : 'ALWAYS'
      armored = true
    }

Snapshot activation

  • Ensure nexus2.app.active = 'SNAPSHOT' aligns with your version detection (e.g. version.endsWith("-SNAPSHOT")).

Plugin defaults

  • If you adopt the central-publishing-maven-plugin, you can drop manual URLs and rely on its default centralBaseUrl = 'https://central.sonatype.com'.
🧹 Nitpick comments (5)
examples/src/main/kotlin/dashj/org/platform/DisplayIdentityKeys.kt (1)

27-29: Security consideration: Recovery phrase input is not masked.

The recovery phrase is read as plain text from the console, making it visible to anyone who can see the terminal.

Consider using System.console() for masked input:

-            println("Enter a recovery phrase: ")
-            val scanner = Scanner(System.`in`)
-            val phrase = scanner.nextLine()
+            val console = System.console()
+            val phrase = if (console != null) {
+                String(console.readPassword("Enter recovery phrase (hidden): "))
+            } else {
+                println("Enter a recovery phrase: ")
+                Scanner(System.`in`).use { it.nextLine() }
+            }
dash-sdk-java/src/test/java/org/dashj/platform/sdk/BaseTest.java (1)

29-32: Fix the naming inconsistency in the field name.

The field name walletUtilsContracId is missing a 't' compared to other contract ID fields in the class (dpnsContractId, dashPayContractId, contractIdentifier).

Apply this diff to maintain consistency:

-    static byte[] walletUtilsContracId = new byte[]{
+    static byte[] walletUtilsContractId = new byte[]{
         92, 20, 14, 101, 92, 2, 101, (byte)187, (byte)194, (byte)168, 8, 113, 109, (byte)225, (byte)132, 121, (byte)133, 19, 89, 24, (byte)173,
         81, (byte)205, (byte)253, 11, 118, 102, 75, (byte)169, 91, (byte)163, 124
     };
README.md (1)

32-52: Improve formatting and clarify deployment instructions.

The expanded build instructions are much more comprehensive, but there are some formatting and clarity issues:

  1. Step numbering is inconsistent (numbered list vs bullet points)
  2. Step 4 mentions "Stage all artifacts to a local directory" but doesn't clarify this is local staging for deployment
  3. The transition from step 4 to 5 could be clearer

Apply this diff to improve consistency and clarity:

-Build the android libraries to publish to Maven Central:
-1) Verify release & deploy configuration
+### Build the android libraries to publish to Maven Central:
+
+1. Verify release & deploy configuration
 ```bash
 ./gradlew jreleaserConfig

-2) Ensure a clean deployment
+
+2. Ensure a clean deployment

./gradlew clean

-3) Generate all needed code for SWIG and Protobuf
+
+3. Generate all needed code for SWIG and Protobuf

./gradlew generateSWIG && ./gradlew generateProto

-4) Stage all artifacts to a local directory
+
+4. Stage all artifacts to local staging directory

./gradlew publish

-5) Deploy and release
+
+5. Deploy and release to Maven Central

./gradlew jreleaserDeploy

</blockquote></details>
<details>
<summary>dpp/src/test/kotlin/org/dashj/platform/dapiclient/DapiGrpcClientTest.kt (1)</summary><blockquote>

`298-302`: **Clarify the purpose of the repeated transaction retrieval loop.**

The loop calling `getTransactionBytesKotlin` 101 times appears to be a stress test or consistency check. Consider adding a comment explaining the purpose, or removing it if it was added for debugging.


```diff
+        // Stress test: verify consistent transaction retrieval across multiple calls
         for (i in 0..100) {
             val resultOfI: ByteArray? = client.getTransactionBytesKotlin(txid)
             println("$i. ${Utils.HEX.encode(resultOfI!!)}")
         }
platform-mobile/src/config.rs (1)

275-290: LGTM: Platform version integration in setup_api.

The addition of the version parameter and .with_version(version) calls on the SdkBuilder correctly integrates platform versioning. Note that there are two .with_version(version) calls (lines 279 and 288) - while this is redundant, it shouldn't cause issues as the second call will overwrite the first.

Consider removing the duplicate .with_version(version) call:

-            let builder = dash_sdk::SdkBuilder::new(self.address_list())
-                .with_version(version)
-                .with_core(
+            let builder = dash_sdk::SdkBuilder::new(self.address_list())
+                .with_core(
                 &self.core_ip,
                 self.core_port,
                 &self.core_user,
                 &self.core_password,
             );

             builder
                 .with_version(version)
                 .build().expect("cannot initialize api")
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2a826d8 and f37a186.

⛔ Files ignored due to path filters (3)
  • dash-sdk-android/src/main/rust/Cargo.lock is excluded by !**/*.lock
  • dash-sdk-bindings/Cargo.lock is excluded by !**/*.lock
  • platform-mobile/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (39)
  • README.md (1 hunks)
  • build.gradle (1 hunks)
  • dash-sdk-android/build.gradle (5 hunks)
  • dash-sdk-android/src/main/AndroidManifest.xml (1 hunks)
  • dash-sdk-android/src/main/rust/Cargo.toml (2 hunks)
  • dash-sdk-android/src/main/rust/build.rs (1 hunks)
  • dash-sdk-bindings/Cargo.toml (2 hunks)
  • dash-sdk-bindings/build.rs (1 hunks)
  • dash-sdk-bindings/rust-toolchain.toml (1 hunks)
  • dash-sdk-java/build.gradle (3 hunks)
  • dash-sdk-java/ignore.py (1 hunks)
  • dash-sdk-java/src/main/cpp/context_provider.cpp (1 hunks)
  • dash-sdk-java/src/main/cpp/conversions.h (1 hunks)
  • dash-sdk-java/src/main/swig/platform_value.i (3 hunks)
  • dash-sdk-java/src/main/swig/root.i (2 hunks)
  • dash-sdk-java/src/test/java/org/dashj/platform/sdk/BaseTest.java (1 hunks)
  • dash-sdk-java/src/test/java/org/dashj/platform/sdk/BinaryDataTest.java (0 hunks)
  • dash-sdk-java/src/test/java/org/dashj/platform/sdk/DataContractTest.java (1 hunks)
  • dash-sdk-java/src/test/java/org/dashj/platform/sdk/ValueTest.java (2 hunks)
  • dpp/build.gradle (2 hunks)
  • dpp/src/main/java/org/dashj/platform/dashpay/Profiles.kt (2 hunks)
  • dpp/src/main/java/org/dashj/platform/dpp/util/PlatformValueFunctions.kt (2 hunks)
  • dpp/src/test/kotlin/org/dashj/platform/dapiclient/DapiGrpcClientTest.kt (1 hunks)
  • examples/src/main/kotlin/dashj/org/platform/DisplayIdentityKeys.kt (1 hunks)
  • gradle/wrapper/gradle-wrapper.properties (1 hunks)
  • platform-mobile/Cargo.toml (2 hunks)
  • platform-mobile/src/config.rs (8 hunks)
  • platform-mobile/src/core.rs (2 hunks)
  • platform-mobile/src/custom.rs (4 hunks)
  • platform-mobile/src/data_contracts.rs (5 hunks)
  • platform-mobile/src/fetch_identity.rs (1 hunks)
  • platform-mobile/src/lib.rs (0 hunks)
  • platform-mobile/src/provider.rs (4 hunks)
  • platform-mobile/src/put.rs (5 hunks)
  • platform-mobile/src/put_test.rs (6 hunks)
  • platform-mobile/src/sdk.rs (7 hunks)
  • platform-mobile/src/tests/documents.rs (0 hunks)
  • platform-mobile/src/tests/mod.rs (0 hunks)
  • platform-mobile/src/voting.rs (1 hunks)
💤 Files with no reviewable changes (4)
  • platform-mobile/src/lib.rs
  • platform-mobile/src/tests/documents.rs
  • dash-sdk-java/src/test/java/org/dashj/platform/sdk/BinaryDataTest.java
  • platform-mobile/src/tests/mod.rs
🧰 Additional context used
🧬 Code Graph Analysis (4)
platform-mobile/src/fetch_identity.rs (1)
platform-mobile/src/sdk.rs (3)
  • create_dash_sdk (102-116)
  • create_dash_sdk_using_core_mainnet (98-100)
  • create_dash_sdk_using_core_testnet (94-96)
platform-mobile/src/put.rs (1)
dpp/src/main/java/org/dashj/platform/dpp/contract/DataContractCreateTransition.kt (1)
  • entropy (9-57)
dash-sdk-android/src/main/rust/build.rs (1)
dash-sdk-bindings/build.rs (1)
  • main (4-23)
platform-mobile/src/sdk.rs (2)
platform-mobile/src/config.rs (2)
  • address_list (223-252)
  • new (136-157)
platform-mobile/src/provider.rs (2)
  • new (76-98)
  • new (200-205)
🔇 Additional comments (88)
gradle/wrapper/gradle-wrapper.properties (1)

3-3: ✅ Gradle 8.7 Compatibility Verified

All build scripts were scanned and no deprecated configurations were found.

• Seven build.gradle files checked (root, tools, dpp, dash-sdk-java, dashj-platform-android-simple, examples, dash-sdk-android)
• No compile or testCompile usages detected
• Publishing is done via the maven-publish plugin (fully supported in Gradle 8.x)

No further changes are needed before upgrading the wrapper to Gradle 8.7.

examples/src/main/kotlin/dashj/org/platform/DisplayIdentityKeys.kt (1)

33-33: No import needed for DefaultIdentity
Both DefaultIdentity.kt and DisplayIdentityKeys.kt declare
package dashj.org.platform, so DefaultIdentity is in the same package and doesn’t require an import.

You can ignore the suggested import.

Likely an incorrect or invalid review comment.

dash-sdk-bindings/rust-toolchain.toml (1)

3-3: No Rust version reference in README.md; no update required.

The verification script confirms that README.md contains no Rust version mentions, so there’s nothing to synchronize.

dash-sdk-android/src/main/AndroidManifest.xml (1)

2-2: Confirm package configuration in Gradle

Verified that dash-sdk-android/build.gradle declares the namespace:

  • Line 9: namespace "org.dashj.platform"

Removal of the package attribute in AndroidManifest.xml is safe.

dash-sdk-java/src/main/cpp/conversions.h (1)

10-10: LGTM: Header path update is consistent with build system restructuring.

The include path update from target/dash_sdk_bindings.h to target/include/dash_sdk_bindings.h aligns with the Platform 2.0 upgrade and build system restructuring mentioned in the PR objectives.

dash-sdk-java/src/main/cpp/context_provider.cpp (1)

4-4: LGTM: Header path update matches restructured build output.

The include path update is consistent with the build system changes across the codebase and aligns with the similar change in conversions.h.

dash-sdk-java/ignore.py (1)

4-4: LGTM: Build script path update aligns with header restructuring.

The header file path update in this Python build script is consistent with the restructured output directory and matches the changes in the C++ files.

platform-mobile/src/core.rs (2)

4-4: LGTM: Platform version import supports explicit versioning.

The import of LATEST_PLATFORM_VERSION aligns with the Platform 2.0 upgrade strategy to introduce explicit platform versioning across SDK components.


23-23: LGTM: SDK setup now uses explicit platform versioning.

Passing LATEST_PLATFORM_VERSION to cfg.setup_api() ensures the SDK is initialized with the correct platform version, which is essential for the Platform 2.0 upgrade.

platform-mobile/src/fetch_identity.rs (1)

16-16: LGTM: Mainnet SDK creation function import prepares for network flexibility.

Adding create_dash_sdk_using_core_mainnet to the imports aligns with the Platform 2.0 upgrade and provides consistency across network-specific SDK creation functions, even though it's not used in this file yet.

platform-mobile/src/voting.rs (1)

66-66: LGTM! Backward-compatible configuration enhancement.

The addition of state_transition_creation_options: None to the PutSettings struct follows the established pattern across the codebase and maintains backward compatibility by defaulting to None. This enhances configurability for state transition creation as part of the Platform 2.0 upgrade.

dash-sdk-java/src/main/swig/root.i (1)

5-5: LGTM! Necessary header path updates for build system refactoring.

The header file path updates from /target/dash_sdk_bindings.h to /target/include/dash_sdk_bindings.h are consistent between the C++ preprocessor directive and SWIG include directive. This aligns with the broader build system reorganization as part of the Platform 2.0 upgrade.

Also applies to: 94-94

README.md (1)

55-55: LGTM! Version updated correctly for Platform 2.0.

The version update from "1.7.5" to "2.0.0-SNAPSHOT" correctly reflects the Platform 2.0 upgrade mentioned in the PR objectives.

build.gradle (4)

2-2: LGTM! Version bump aligns with Platform 2.0 upgrade.

The major version bump to 2.0.0-SNAPSHOT is appropriate for the platform upgrade mentioned in the PR objectives.


8-8: LGTM! Repository addition supports JReleaser plugin.

The gradlePluginPortal() repository is correctly added to support the new JReleaser plugin dependency.


15-15: LGTM! JReleaser plugin supports modern artifact publishing.

The JReleaser plugin addition at version 1.17.0 aligns with the migration to modern artifact publishing mentioned in the PR summary.


13-13: Confirm Android modules build and run under AGP 8.1.4

We’ve located two Android modules that rely on the Gradle plugin:

  • dash-sdk-android/build.gradle
  • dashj-platform-android-simple/build.gradle

Please manually run a full build and smoke-test on each module (e.g. ./gradlew :dash-sdk-android:assembleDebug and :dashj-platform-android-simple:assembleDebug, plus any unit/instrumentation tests) to verify there are no breaking-change issues with AGP 8.1.4. If you encounter errors, update your module configurations (compileSdk, dependencies, AndroidX migrations, etc.) accordingly.

dash-sdk-java/src/test/java/org/dashj/platform/sdk/DataContractTest.java (1)

25-36: LGTM! Test extends coverage for wallet utils data contract.

The new test method follows the established pattern and correctly tests fetching the wallet utils data contract. The assertion for exactly 1 document type is appropriate for this contract type.

dash-sdk-android/src/main/rust/Cargo.toml (4)

3-3: LGTM! Version bump consistent with Platform 2.0 upgrade.

The version change from 1.0.0 to 2.0.0 aligns with the major platform upgrade objectives.


25-25: LGTM! Improved stability with tagged dependency.

Moving from branch "master" to tag "v0.39.6" for dashcore dependency improves build reproducibility and stability.


31-31: LGTM! Ferment dependency supports FFI refactoring.

The ferment dependency addition at tag "v0.2.3" aligns with the FFI refactoring mentioned in the PR summary.


35-37: LGTM! Build dependency transition to ferment-sys with appropriate feature selection.

The transition from ferment to ferment-sys with the "cbindgen_only" feature is appropriate for C binding generation. The commented alternatives provide good documentation of configuration options.

platform-mobile/src/put.rs (5)

411-411: LGTM! Consistent PutSettings field addition.

The addition of state_transition_creation_options: None to PutSettings maintains backward compatibility while enabling future extensibility for state transition creation options.


483-483: LGTM! Consistent field addition in topup_identity_sdk.

The PutSettings field addition is consistent with the pattern established in other functions.


515-517: LGTM! Method call updates match evolved API signature.

The changes to wrap entropy in Some() and add an additional None argument indicate the put_to_platform method signature has evolved to accept optional parameters.


610-610: LGTM! Consistent PutSettings field addition in put_document_sdk.

The field addition maintains consistency with other functions in the file.


736-736: LGTM! Consistent PutSettings field addition in replace_document_sdk.

The field addition maintains consistency with other functions in the file.

platform-mobile/src/put_test.rs (6)

29-29: LGTM! Import addition supports platform versioning.

The addition of LATEST_PLATFORM_VERSION to the import supports the platform versioning integration in SDK setup.


198-198: LGTM! Test PutSettings updated for compatibility.

The PutSettings field addition maintains test compatibility with the updated struct definition.


326-326: LGTM! Consistent PutSettings update in second test.

The field addition ensures consistency across test functions.


215-217: LGTM! Method calls updated for API compatibility.

The method call updates wrap entropy in Some() and add None arguments to match the evolved API signature.


251-253: LGTM! Consistent method call updates in second test.

The method call changes maintain consistency with the API updates.


305-305: LGTM! SDK setup updated with platform versioning.

The SDK setup call now correctly passes LATEST_PLATFORM_VERSION, aligning with the platform versioning integration.

dash-sdk-bindings/Cargo.toml (3)

3-3: LGTM! Version bump aligns with Platform 2.0 upgrade.

The major version bump from 1.0.0 to 2.0.0 is appropriate for this platform upgrade.


7-8: Good practice: Moving to tagged dependencies for stability.

The migration from branch-based dependencies to fixed tag versions (v0.2.3) improves build reproducibility and stability.


33-34: Build dependency configuration looks correct.

The ferment-sys dependency with cbindgen_only feature is properly configured for the build process. The commented alternative without features provides flexibility if needed.

platform-mobile/Cargo.toml (3)

3-3: LGTM! Consistent version bump across platform modules.

The major version bump to 2.0.0 is consistent with the platform-wide upgrade.


7-8: Consistent dependency management across modules.

The ferment dependencies are updated consistently with dash-sdk-bindings, ensuring compatibility across the platform.


48-51: dashcore-rpc consolidation safe—no compatibility issues detected

Our searches in platform-mobile show no code or docs importing or invoking the dashcore-rpc crate:

• No dashcore_rpc:: or dashcore-rpc usages in Rust source files
• Only a single entry in platform-mobile/Cargo.toml (lines 50–51)
• No mentions in Markdown or example code

Since neither crate is actually referenced in the codebase, pointing both dashcore and dashcore-rpc at [email protected] introduces no runtime or build‐time conflicts. You may leave the existing TODO to remove dashcore-rpc once the core RPC implementation is in place.

dash-sdk-java/src/test/java/org/dashj/platform/sdk/ValueTest.java (3)

143-143: Consistent with platform-wide removal of I128 support.

The commenting out of the I128 test case aligns with the broader removal of 128-bit integer support across the platform.


181-181: I128 assertion removal is consistent.

The removal of the I128 exception test is appropriate given the removal of I128 support from the platform.


1-198: Ignore outdated test removal concern.
Both createPlatformValueTest and createPlatformValueMapTest are still defined in ValueTest.java; no PlatformValue tests were removed and coverage remains intact.

Likely an incorrect or invalid review comment.

dpp/src/test/kotlin/org/dashj/platform/dapiclient/DapiGrpcClientTest.kt (1)

288-292: Good separation of concerns for debugging.

Separating the response retrieval from byte extraction and adding response printing improves debugging capabilities.

dash-sdk-java/src/main/swig/platform_value.i (3)

28-29: Systematic removal of 128-bit integer constructors.

The commenting out of U128 and I128 constructors is consistent with the platform-wide removal of 128-bit integer support.


116-122: Consistent removal of 128-bit integer getters.

The removal of I128 and U128 getter methods aligns with the constructor removals and platform changes.


152-152: Complete removal of I128 support in SWIG interface.

The commenting out of the I128 ignore directive completes the systematic removal of 128-bit integer support from the SWIG interface.

dash-sdk-android/src/main/rust/build.rs (2)

1-23: LGTM! Clean migration to ferment_sys with consistent API usage.

The migration from ferment to ferment_sys follows the same pattern as dash-sdk-bindings/build.rs, using the fluent API approach which is cleaner than manual cbindgen command invocation. The error handling with match/panic is appropriate for build scripts.


5-5: Confirm crate name constant aligns with Cargo.toml

  • Cargo.toml declares name = "dash-sdk-bindings".
  • Rust converts hyphens to underscores for the crate identifier, so dash_sdk_bindings is correct.
  • A search for rs_sdk_bindings returned no matches.

No changes required.

dpp/build.gradle (2)

8-8: LGTM! Consistent JReleaser plugin application.

The addition of the JReleaser plugin aligns with the modernization effort described in the PR objectives.


152-156: LGTM! Simplified Maven repository configuration.

The change to use a local staging directory (build/staging-deploy) instead of remote repository URLs with credentials simplifies the publishing configuration and delegates deployment management to JReleaser.

dash-sdk-bindings/build.rs (1)

1-23: LGTM! Consistent migration pattern with dash-sdk-android.

This build script follows the exact same migration pattern as dash-sdk-android/src/main/rust/build.rs, demonstrating good consistency across the codebase. The fluent API approach with ferment_sys is cleaner and more maintainable than the previous manual approach.

platform-mobile/src/provider.rs (4)

11-11: LGTM! Appropriate import addition for new functionality.

The TokenConfiguration import supports the new get_token_configuration method.


21-21: LGTM! Platform version import for version-aware functionality.

The PlatformVersion import supports the updated get_data_contract method signature.


180-183: LGTM! Default implementation for new trait method.

The get_token_configuration method provides a sensible default implementation returning Ok(None), which allows for graceful handling when token configurations are not available.


142-146: Double-check all get_data_contract signatures after adding platform_version

I see the impl for ContextProvider::get_data_contract in
platform-mobile/src/provider.rs now takes
(&self, data_contract_id: &Identifier, platform_version: &PlatformVersion),
but I wasn’t able to locate a local trait ContextProvider definition (it’s likely imported from the upstream dpp crate). Please verify:

  • The trait signature in the dpp crate has been updated to include platform_version: &PlatformVersion.
  • The FFI wrapper in platform-mobile/src/sdk.rs (and any other callers of get_data_contract) now passes the new platform_version argument.
  • Any additional ContextProvider implementations (if they exist) have been updated to match the new signature.

Run a full build and test cycle to ensure no mismatches remain.

dash-sdk-android/build.gradle (5)

6-6: LGTM! Consistent JReleaser plugin application.

The JReleaser plugin application follows the same pattern as other modules in this upgrade.


106-106: LGTM! Modern Gradle API usage for archive classifiers.

The update to use archiveClassifier.set() instead of the deprecated assignment approach follows current Gradle best practices.

Also applies to: 121-121


134-135: LGTM! Consistent version management.

Extracting the version from the root project ensures consistent versioning across all modules.


172-175: LGTM! Consistent staging directory approach.

The local staging directory approach matches the pattern used in other modules and simplifies the publishing configuration.


176-215: LGTM! Android-optimized JReleaser configuration.

The JReleaser configuration is well-structured with Android-specific optimizations:

  • applyMavenCentralRules = false is correctly set for AAR files (line 206)
  • MIT license specification aligns with the pom configuration
  • Staging directory references are consistent

The configuration properly handles both release and snapshot deployments.

platform-mobile/src/data_contracts.rs (6)

17-22: LGTM: SDK import expansion aligns with platform versioning updates.

The expanded imports for create_dash_sdk_using_core_mainnet and create_dash_sdk_using_single_evonode support the new network configuration testing added in this file.


50-57: LGTM: DataContract V1 variant handling implemented correctly.

The implementation correctly mirrors the V0 variant handling pattern, accessing the same contract methods (id(), owner_id(), document_types, version()) through the appropriate trait methods.


118-124: Enhanced debugging with structured logging.

The addition of tracing logs for both the fetched DataContract and its FFI representation will help with debugging data contract fetching issues.


151-152: Consistent logging approach in tests.

The change from tracing::info! to println! maintains consistency with the other test functions in this file.


154-200: Comprehensive test coverage for wallet utils contract.

The new test functions provide good coverage for testing wallet utils contract fetching across different network configurations:

  • Mainnet testing
  • All testnet evonodes iteration
  • All mainnet evonodes iteration with failure tracking

The test implementations properly handle different result cases and provide meaningful output.


221-221: Correct keyword conflict resolution.

Using rng.r#gen() instead of rng.gen() properly resolves the Rust keyword conflict with the gen keyword.

dash-sdk-java/build.gradle (4)

9-9: LGTM: Explicit JReleaser plugin application.

The explicit application of the org.jreleaser plugin is correct and follows Gradle best practices for plugin configuration.


89-89: LGTM: Modern Gradle API usage.

The change from archiveClassifier = 'tests' to archiveClassifier.set("tests") uses the modern Gradle Property API, which is the recommended approach for Gradle 5.0+.


136-141: LGTM: Simplified repository configuration for JReleaser.

The change to use a local staging directory (layout.buildDirectory.dir('staging-deploy')) simplifies the configuration and aligns with JReleaser's workflow where it handles the actual deployment to remote repositories.


143-183: Well-configured JReleaser deployment setup.

The JReleaser configuration properly defines:

  • Project metadata with correct license and author information
  • Signing configuration set to always active with armored output
  • Maven Central deployment via Sonatype with appropriate staging repository
  • Nexus2 configuration for snapshot handling with proper URL and settings

The configuration follows JReleaser best practices for Maven Central deployment.

platform-mobile/src/custom.rs (7)

12-23: LGTM: Correct trait split implementation for OutPoint.

The refactoring properly splits the original FFIConversion trait into FFIConversionFrom and FFIConversionTo, with the ffi_from_const method moved to FFIConversionFrom and ffi_to_const moved to FFIConversionTo. The logic and error handling remain unchanged.


28-28: LGTM: Updated to use ferment crate.

The change from ferment_interfaces::unbox_any to ferment::unbox_any aligns with the dependency migration from ferment-interfaces to ferment.


45-57: LGTM: Consistent trait split for InstantLock.

The trait split implementation for InstantLock follows the same correct pattern as OutPoint, maintaining the existing logic while properly separating the conversion directions.


62-62: LGTM: Consistent ferment crate usage in Drop implementation.

The update to use ferment::unbox_any maintains consistency with the dependency migration.


79-91: LGTM: Consistent trait split for Transaction.

The Transaction struct's trait split implementation follows the same correct pattern, properly separating FFIConversionFrom and FFIConversionTo while maintaining existing functionality.


96-96: LGTM: Updated Drop implementation for Transaction.

The change to ferment::unbox_any maintains consistency with the dependency migration throughout the file.


106-111: LGTM: Updated commented code for consistency.

Even the commented code has been updated to use the ferment:: prefix, maintaining consistency should this code be uncommented in the future.

platform-mobile/src/sdk.rs (6)

8-12: LGTM: Updated imports for dependency migration and platform versioning.

The import changes correctly reflect:

  • Migration from ferment_interfaces to ferment
  • Addition of platform versioning imports (PlatformVersion, PLATFORM_V7, PLATFORM_V9)

67-85: LGTM: Platform version parameter added to address list update function.

The addition of the version parameter to update_sdk_with_address_list maintains consistency with other SDK setup functions and properly propagates the version to the underlying setup call.


167-173: LGTM: Enhanced logging and proper version propagation.

The addition of platform version and SDK version logging improves debugging capabilities. The version parameter is correctly passed to the setup functions.


212-224: LGTM: Platform version handling in single evonode setup.

The platform version selection logic (V9 for testnet, V7 for mainnet) and proper propagation to setup functions is implemented correctly, though it differs from the other SDK creation method as noted above.


232-234: LGTM: Increased timeout values for better reliability.

The increase from 5 to 10 seconds for both connect_timeout and timeout in the single evonode configuration should improve reliability when connecting to individual evonodes, which may have more variable response times than load-balanced endpoints.


149-156: Inconsistent platform version selection across SDK constructors

I noticed two different version‐selection patterns in platform-mobile/src/sdk.rs:

  • create_dash_sdk_with_context (lines ~149–156):
    Both testnet and mainnet unconditionally use PLATFORM_V9.

  • create_dash_sdk_using_single_evonode (lines ~212–216):
    Testnet uses PLATFORM_V9 but mainnet falls back to PLATFORM_V7.

Please confirm the intended strategy:

  • Should mainnet always use the same version as testnet (i.e. PLATFORM_V9), or should it remain on PLATFORM_V7 in some contexts?
  • If the goal is to keep both constructors aligned, should we update one of these methods so they follow identical logic?

Once clarified, we can adjust the code accordingly.

platform-mobile/src/config.rs (5)

21-25: LGTM: Updated imports for dependency migration and platform versioning.

The import changes correctly reflect the migration from ferment_interfaces to ferment and the addition of platform versioning support with PlatformVersion and PLATFORM_V7 imports.


295-312: LGTM: Consistent platform version integration in setup_api_list.

The platform version parameter addition and .with_version(version) call are correctly implemented, maintaining consistency with the other setup methods.


342-382: LGTM: Platform version integration in callback-based setup.

The addition of the version parameter and proper integration with the SdkBuilder via .with_version(&version) (note the reference operator) is correctly implemented.


390-413: LGTM: Consistent platform version handling in list-based callback setup.

The platform version parameter and .with_version(version) integration are correctly implemented, maintaining consistency across all setup methods.


67-69: Verify mainnet address list reduction

The MAINNET_ADDRESS_LIST size changed from 128 to 92 entries. Please confirm that:

  • The 36 removed addresses were intentionally deprecated or found unreliable
  • The remaining addresses still deliver sufficient geographic and network redundancy
  • Any related documentation (README, deployment guides, etc.) is updated to reflect the new list size

Snippet for reference (platform-mobile/src/config.rs):

- pub const MAINNET_ADDRESS_LIST: [&str; 128] = [ … ];
+ pub const MAINNET_ADDRESS_LIST: [&str; 92]  = [ … ];

Comment on lines +24 to +30
dashcore = { git = "https://github.com/dashpay/rust-dashcore", features = [
"std",
"secp-recovery",
"rand",
"signer",
"serde",
], default-features = false, tag = "v0.39.6" }
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Verify dashcore dependency features and compatibility.

The new dashcore dependency includes several features (std, secp-recovery, rand, signer, serde) with default features disabled. Ensure these features are necessary and compatible with the current platform version.


🏁 Script executed:

#!/bin/bash
# Verify dashcore dependency usage and feature requirements
echo "Searching for dashcore usage in the codebase..."
rg -A 3 -B 3 "dashcore::" --type rust
echo "Checking for secp-recovery feature usage..."
rg -A 2 -B 2 "secp.*recovery" --type rust

Length of output: 11691


🏁 Script executed:

#!/bin/bash
# Verify dashcore feature usage specifically within the dash-sdk-bindings crate
echo "Scanning dash-sdk-bindings/src for direct dashcore imports..."
rg -A2 -B2 "dashcore::" dash-sdk-bindings/src --type rust || true

echo -e "\nChecking for secp-recovery (recovery API) usage..."
rg -A2 -B2 "recover" dash-sdk-bindings/src --type rust || true

echo -e "\nLooking for rand usage in dash-sdk-bindings..."
rg -A2 -B2 "rand::" dash-sdk-bindings/src --type rust || true

echo -e "\nLooking for serde usage in dash-sdk-bindings..."
rg -A2 -B2 "serde::" dash-sdk-bindings/src --type rust || true

Length of output: 719


Remove or Justify Unused dashcore Features in dash-sdk-bindings/Cargo.toml

We scanned dash-sdk-bindings/src and didn’t find any direct dashcore:: imports, nor usage of secp-recovery, rand, signer or serde APIs in that crate. Please trim these feature flags down to only what’s actually needed, or add comments explaining why each is required (e.g., pulled in transitively by dash-sdk). Also verify that the remaining features work correctly on your target platforms.

Files to update:

  • dash-sdk-bindings/Cargo.toml (lines 24–30)

Suggested diff:

 dashcore = { 
     git = "https://github.com/dashpay/rust-dashcore", 
-    features = [
-        "std",
-        "secp-recovery",
-        "rand",
-        "signer",
-        "serde",
-    ], 
+    // enable only the features actually used by this crate
+    features = [
+        // e.g. "std",
+    ], 
     default-features = false, 
     tag = "v0.39.6" 
 }
📝 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
dashcore = { git = "https://github.com/dashpay/rust-dashcore", features = [
"std",
"secp-recovery",
"rand",
"signer",
"serde",
], default-features = false, tag = "v0.39.6" }
dashcore = {
git = "https://github.com/dashpay/rust-dashcore",
// enable only the features actually used by this crate
features = [
// e.g. "std",
],
default-features = false,
tag = "v0.39.6"
}
🤖 Prompt for AI Agents
In dash-sdk-bindings/Cargo.toml between lines 24 and 30, the dashcore dependency
includes multiple feature flags that appear unused in the dash-sdk-bindings/src
code. Review the codebase to confirm which dashcore features are actually
required, then remove any unused features from the list to minimize unnecessary
dependencies. If some features are needed transitively or for platform
compatibility, add clear comments next to each feature flag explaining their
purpose. Finally, test the crate on target platforms to ensure the trimmed
feature set works correctly.

Comment on lines +28 to +29
//CTOR(U128, uint128_t)
//CTOR(I128, int128_t)
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Verify complete removal of 128-bit integer references.

Ensure that all references to 128-bit integer types have been consistently removed or commented out across the codebase to prevent compilation issues.

Also applies to: 116-122, 152-152


🏁 Script executed:

#!/bin/bash
# Search for any remaining 128-bit integer references
echo "Searching for remaining I128/U128 references..."
rg -i "i128|u128" --type java --type cpp --type c
echo "Checking SWIG files for 128-bit integer references..."
fd -e i -x rg -H "i128|u128" {} \;
echo "Verifying no active BigInteger conversions for 128-bit types..."
rg -A 3 -B 3 "BigInteger.*128|128.*BigInteger"

Length of output: 4429


Remove all remaining 128-bit integer references

Our search shows that 128-bit types and their Java/BigInteger mappings are still present in several places. Please remove or comment out every residual definition, SWIG mapping, and test reference to i128/u128:

• dash-sdk-java/src/main/cpp/int128.h
– typedefs for int128_t i128, __int128 i128, uint128_t u128, unsigned __int128 u128

• SWIG interface files:
– src/main/swig/i128.i – delete or fully comment out this file (all %typemap mappings)
– src/main/swig/ignore.i – remove lines
swig %ignore platform_value_Value_U128_ctor(u128 o_o_0); %ignore platform_value_Value_I128_ctor(i128 o_o_0);
– src/main/swig/platform_value.i – ensure the VALUE_GET(I128,…), VALUE_GET(U128,…), and VALUE_IGNORE entries are all removed or commented out
– src/main/swig/root.i – remove %include "i128.i" and %ignore i128;

• Unit tests:
– dash-sdk-java/src/test/java/org/dashj/platform/sdk/ValueTest.java – delete or comment out any lines referencing BigInteger i128Value, PlatformValue.Tag.I128/U128, and related assertions

Fix these locations so that no 128-bit integer types or their Java conversions remain.

🤖 Prompt for AI Agents
In dash-sdk-java/src/main/swig/platform_value.i around lines 28 to 29, remove or
comment out all references to 128-bit integer types, specifically the VALUE_GET
and VALUE_IGNORE entries related to I128 and U128. This is part of a broader
cleanup to eliminate all 128-bit integer definitions and mappings across the
codebase, including typedefs in int128.h, SWIG interface files like i128.i and
ignore.i, and unit tests referencing these types.

signer: WalletSignerCallback
): Document {
val profileDocument = createProfileDocument(displayName, publicMessage, avatarUrl, avatarHash, avatarFingerprint, identity)
log.info("creating profile document: {}", profileDocument.toJSON())
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Consider PII implications of logging profile document JSON.

The profile document JSON may contain personally identifiable information like display names, public messages, and avatar URLs. Logging this at INFO level could expose sensitive data in production logs.

Consider one of these approaches:

-        log.info("creating profile document: {}", profileDocument.toJSON())
+        log.debug("creating profile document: {}", profileDocument.toJSON())

Or filter sensitive fields:

-        log.info("creating profile document: {}", profileDocument.toJSON())
+        log.info("creating profile document with type: {}, revision: {}", profileDocument.type, profileDocument.revision)
🤖 Prompt for AI Agents
In dpp/src/main/java/org/dashj/platform/dashpay/Profiles.kt at line 46, the
current logging statement outputs the entire profile document JSON, which may
contain sensitive personally identifiable information. To fix this, modify the
logging to either exclude or mask sensitive fields such as display names, public
messages, and avatar URLs before logging, or reduce the log level to DEBUG or
TRACE to avoid exposing this data in production logs.

profileDocument.updatedAt = Date().time
profileDocument.revision += 1

log.info("replacing profile document: {}", profileDocument.toJSON())
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Consider PII implications of logging profile document JSON.

Similar to the create method, this logs potentially sensitive profile data at INFO level.

Apply the same PII protection as suggested for the create method:

-        log.info("replacing profile document: {}", profileDocument.toJSON())
+        log.debug("replacing profile document: {}", profileDocument.toJSON())

Or use filtered logging:

-        log.info("replacing profile document: {}", profileDocument.toJSON())
+        log.info("replacing profile document with type: {}, revision: {}", profileDocument.type, profileDocument.revision)
📝 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
log.info("replacing profile document: {}", profileDocument.toJSON())
log.debug("replacing profile document: {}", profileDocument.toJSON())
Suggested change
log.info("replacing profile document: {}", profileDocument.toJSON())
log.info(
"replacing profile document with type: {}, revision: {}",
profileDocument.type,
profileDocument.revision
)
🤖 Prompt for AI Agents
In dpp/src/main/java/org/dashj/platform/dashpay/Profiles.kt at line 103, the log
statement outputs the full profile document JSON at INFO level, which may expose
personally identifiable information (PII). Modify the logging to either redact
sensitive fields from the profileDocument before logging or implement a filtered
logging method that excludes PII, similar to the approach used in the create
method. Ensure the log message does not contain raw sensitive data to protect
user privacy.

Comment on lines +85 to +86
//PlatformValue.Tag.U128 -> value.u128
//PlatformValue.Tag.I128 -> value.i128
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Remove commented code or add TODO explaining temporary removal.

The 128-bit integer handling code is commented out but not removed. If this is a permanent removal as part of disabling 128-bit support, the commented lines should be deleted completely to avoid maintenance overhead.

If the removal is permanent, apply this diff:

-        //PlatformValue.Tag.U128 -> value.u128
-        //PlatformValue.Tag.I128 -> value.i128

If the removal is temporary, add a TODO comment explaining when it will be re-enabled:

-        //PlatformValue.Tag.U128 -> value.u128
-        //PlatformValue.Tag.I128 -> value.i128
+        // TODO: Re-enable 128-bit integer support when Platform X.Y is released
+        //PlatformValue.Tag.U128 -> value.u128
+        //PlatformValue.Tag.I128 -> value.i128
📝 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
//PlatformValue.Tag.U128 -> value.u128
//PlatformValue.Tag.I128 -> value.i128
Suggested change
//PlatformValue.Tag.U128 -> value.u128
//PlatformValue.Tag.I128 -> value.i128
// TODO: Re-enable 128-bit integer support when Platform X.Y is released
//PlatformValue.Tag.U128 -> value.u128
//PlatformValue.Tag.I128 -> value.i128
🤖 Prompt for AI Agents
In dpp/src/main/java/org/dashj/platform/dpp/util/PlatformValueFunctions.kt
around lines 85 to 86, the 128-bit integer handling code is commented out
without explanation. If this removal is permanent, delete these commented lines
entirely to reduce maintenance overhead. If it is temporary, add a TODO comment
clarifying when or under what conditions this code will be re-enabled.

is Int -> PlatformValue(value)
is Long -> PlatformValue(value)
is BigInteger -> PlatformValue(value)
//is BigInteger -> PlatformValue(value)
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Remove commented BigInteger conversion or add TODO.

Similar to the 128-bit integer handling above, this commented BigInteger conversion should either be removed completely or documented with a TODO if temporary.

Apply the same approach as suggested for the 128-bit integer handling above.

🤖 Prompt for AI Agents
In dpp/src/main/java/org/dashj/platform/dpp/util/PlatformValueFunctions.kt at
line 151, there is a commented-out BigInteger conversion. To maintain code
clarity and consistency with the 128-bit integer handling, either remove this
commented line entirely if it is no longer needed, or add a clear TODO comment
explaining why it is commented out and what future action is required.

Comment on lines +28 to +29
val scanner = Scanner(System.`in`)
val phrase = scanner.nextLine()
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Improve resource management and null safety.

Two issues: Scanner resource leak and unsafe null assertion on wallet.

-            val scanner = Scanner(System.`in`)
-            val phrase = scanner.nextLine()
+            Scanner(System.`in`).use { scanner ->
+                val phrase = scanner.nextLine()
+                // ... rest of logic inside use block
+            }

And for the wallet access:

-            val authGroup = client.wallet!!.getKeyChainExtension(AuthenticationGroupExtension.EXTENSION_ID) as AuthenticationGroupExtension
+            val wallet = client.wallet ?: run {
+                println("Error: Wallet not initialized")
+                return
+            }
+            val authGroup = wallet.getKeyChainExtension(AuthenticationGroupExtension.EXTENSION_ID) as AuthenticationGroupExtension

Also applies to: 40-40

🤖 Prompt for AI Agents
In examples/src/main/kotlin/dashj/org/platform/DisplayIdentityKeys.kt at lines
28-29 and 40, fix the Scanner resource leak by using a Kotlin 'use' block to
automatically close the Scanner after reading input. For the wallet access,
replace unsafe null assertions with safe calls or proper null checks to avoid
potential NullPointerExceptions. This ensures better resource management and
null safety.

val scanner = Scanner(System.`in`)
val phrase = scanner.nextLine()

MnemonicCode().check(phrase.split(" ", "\n"))
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Add exception handling for mnemonic validation.

MnemonicCode().check() can throw MnemonicException if the phrase is invalid, which will crash the application.

-            MnemonicCode().check(phrase.split(" ", "\n"))
+            try {
+                MnemonicCode().check(phrase.split(" ", "\n"))
+            } catch (e: Exception) {
+                println("Invalid recovery phrase: ${e.message}")
+                return
+            }
🤖 Prompt for AI Agents
In examples/src/main/kotlin/dashj/org/platform/DisplayIdentityKeys.kt at line
31, the call to MnemonicCode().check() can throw a MnemonicException if the
phrase is invalid, which currently is not handled and may crash the application.
Wrap this call in a try-catch block to catch MnemonicException and handle it
gracefully, such as logging the error or notifying the user, to prevent the
application from crashing.

@HashEngineering HashEngineering merged commit c1699e5 into main Jul 29, 2025
1 check passed
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.

2 participants