Skip to content

feat: improve txmetadata#38

Open
HashEngineering wants to merge 4 commits into
mainfrom
feat/improve-txmetadata
Open

feat: improve txmetadata#38
HashEngineering wants to merge 4 commits into
mainfrom
feat/improve-txmetadata

Conversation

@HashEngineering

@HashEngineering HashEngineering commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features

    • Added support for three new transaction metadata fields: order, gift card challenge, and index. These fields are fully integrated across all metadata operations including serialization, storage, and conversion.
  • Chores

    • Version updated to 2.0.6-SNAPSHOT.

@HashEngineering HashEngineering self-assigned this Jun 19, 2026
@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@HashEngineering, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 26 minutes and 7 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 77453c8e-37e0-4d70-950c-1f6e11b07ef2

📥 Commits

Reviewing files that changed from the base of the PR and between 8dcd14d and 87ce6cf.

📒 Files selected for processing (2)
  • dpp/src/main/java/org/dashj/platform/dashpay/BlockchainIdentity.kt
  • dpp/src/main/java/org/dashj/platform/wallet/TxMetadataItem.kt
📝 Walkthrough

Walkthrough

The PR bumps the project version from 2.0.5 to 2.0.6-SNAPSHOT in build.gradle and README.md, and extends TxMetadataItem with three new optional fields—order, giftCardChallenge, and index—added to the protobuf schema and fully wired through the Kotlin class constructor, serialization, deserialization, equality, and emptiness logic.

Changes

TxMetadataItem new fields

Layer / File(s) Summary
Protobuf schema: new fields 17–19
dpp/src/main/proto/wallet-utils.proto
Adds optional string order = 17, optional string giftCardChallenge = 18, and optional uint32 index = 19 to the TxMetadataItem message.
Kotlin class contract: constructor and KDoc
dpp/src/main/java/org/dashj/platform/wallet/TxMetadataItem.kt
Adds nullable order: String?, giftCardChallenge: String?, and index: Int? parameters to the primary constructor, and documents them in KDoc.
Deserialization from raw map and proto
dpp/src/main/java/org/dashj/platform/wallet/TxMetadataItem.kt
The rawObject constructor reads order from the note key and reads giftCardChallenge/index directly; the proto constructor maps the three fields with non-empty/non-zero guards.
Serialization: toObject, toJson, toProtobuf
dpp/src/main/java/org/dashj/platform/wallet/TxMetadataItem.kt
toObject() and toJson() conditionally emit the three fields (note/order, giftCardChallenge, index); toJson() map type changes to HashMap<String, Any?>; toProtobuf() sets the three proto fields when non-null.
equals and isNotEmpty updates
dpp/src/main/java/org/dashj/platform/wallet/TxMetadataItem.kt
equals() compares order, giftCardChallenge, and index; isNotEmpty() treats any of the three as a non-empty indicator.

Version bump to 2.0.6-SNAPSHOT

Layer / File(s) Summary
Version bump in build script and README
build.gradle, README.md
ext.version and the README Gradle snippet dppVersion are both updated from 2.0.5 to 2.0.6-SNAPSHOT.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 Hop hop, new fields appear today,
order and index join the fray,
Gift card challenge sneaks right in,
Proto and Kotlin share the win.
Version bumped with a joyful leap—
2.0.6-SNAPSHOT ours to keep! 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'improve txmetadata' is vague and generic, lacking specificity about what improvements were made or which fields were added. Consider a more descriptive title such as 'feat: add order, giftCardChallenge, and index fields to TxMetadataItem' to clearly indicate the scope of changes.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/improve-txmetadata

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
dpp/src/main/java/org/dashj/platform/wallet/TxMetadataItem.kt (1)

34-36: ⚡ Quick win

Add descriptions for giftCardChallenge and index properties.

The KDoc for giftCardChallenge and index is missing descriptions. For consistency and maintainability, provide brief descriptions explaining what these fields represent, similar to the order property on Line 34.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@dpp/src/main/java/org/dashj/platform/wallet/TxMetadataItem.kt` around lines
34 - 36, The KDoc comments for the properties giftCardChallenge and index in the
TxMetadataItem class are missing descriptions, while the order property has a
proper description. Add brief descriptive text for each of the giftCardChallenge
and index properties in their KDoc comments to explain what these fields
represent, matching the documentation style of the order property to maintain
consistency across the class.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@dpp/src/main/java/org/dashj/platform/wallet/TxMetadataItem.kt`:
- Around line 81-84: The order property in the TxMetadataItem class is
serialized as the "note" key in JSON and map representations, but this mapping
convention is not documented. Add documentation to clarify this intentional
mapping, either by adding a comment in the class-level documentation explaining
that the order field is externally serialized as "note", or by placing an inline
comment at the deserialization line (where rawObject["note"] is accessed on line
82) to explain why the property named order is being read from the "note" key.
This will help API consumers understand this non-obvious mapping when they
encounter "note" in serialized data.

---

Nitpick comments:
In `@dpp/src/main/java/org/dashj/platform/wallet/TxMetadataItem.kt`:
- Around line 34-36: The KDoc comments for the properties giftCardChallenge and
index in the TxMetadataItem class are missing descriptions, while the order
property has a proper description. Add brief descriptive text for each of the
giftCardChallenge and index properties in their KDoc comments to explain what
these fields represent, matching the documentation style of the order property
to maintain consistency across the class.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b570dc5b-ac1b-42c0-a00f-2d8798f56fb6

📥 Commits

Reviewing files that changed from the base of the PR and between 60c94e0 and 8dcd14d.

📒 Files selected for processing (4)
  • README.md
  • build.gradle
  • dpp/src/main/java/org/dashj/platform/wallet/TxMetadataItem.kt
  • dpp/src/main/proto/wallet-utils.proto

Comment thread dpp/src/main/java/org/dashj/platform/wallet/TxMetadataItem.kt
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