Skip to content

feat(qt): add support for reporting OP_RETURN payloads as Data Transactions#7144

Draft
kwvg wants to merge 1 commit intodashpay:developfrom
kwvg:data_tx
Draft

feat(qt): add support for reporting OP_RETURN payloads as Data Transactions#7144
kwvg wants to merge 1 commit intodashpay:developfrom
kwvg:data_tx

Conversation

@kwvg
Copy link
Collaborator

@kwvg kwvg commented Feb 15, 2026

Additional Information

Work in progress.

Breaking Changes

None expected.

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation
  • I have assigned this pull request to a milestone (for repository code-owners and collaborators only)

Proposals are made in the form of data transactions but look like oddly
shaped transactions in the UI, this should help better explain where the
proposal fee went.
@kwvg kwvg added this to the 24 milestone Feb 15, 2026
@kwvg kwvg changed the title qt: add support for reporting OP_RETURN payloads as Data Transactions feat(qt): add support for reporting OP_RETURN payloads as Data Transactions Feb 15, 2026
@kwvg kwvg marked this pull request as draft February 15, 2026 07:53
@github-actions
Copy link

This pull request has conflicts, please rebase.

@github-actions
Copy link

✅ No Merge Conflicts Detected

This PR currently has no conflicts with other open PRs.

@kwvg
Copy link
Collaborator Author

kwvg commented Feb 15, 2026

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Feb 15, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai
Copy link

coderabbitai bot commented Feb 15, 2026

Walkthrough

The changes introduce support for a new DataTransaction type in the Qt wallet's transaction display framework. A new enum value is added to TransactionRecord, with detection logic to classify unspendable OP_RETURN outputs as DataTransaction. The UI framework is extended across multiple components to handle this new type: transaction table model updates formatting, coloring, and labeling; transaction view adds a filter option; and transaction description view displays extracted OP_RETURN payload data in hex format. A bitmask constant is updated in the transaction filter proxy.

Sequence Diagram

No sequence diagram generated. The changes apply a consistent pattern of adding new type support across multiple UI components within the same layer, without introducing new inter-component interactions or control flow patterns that would benefit from visualization.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 30.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding support for reporting OP_RETURN payloads as Data Transactions in the Qt UI component.
Description check ✅ Passed The description is related to the changeset, mentioning no breaking changes and linking to PR context, though it does not provide detailed technical rationale for the changes.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into develop

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
src/qt/transactionrecord.h (1)

72-72: Nit: typo in the comment — "TransactionFilterProxyWhen" → "TransactionFilterProxy".

Pre-existing typo, but since this enum is being touched:

Suggested fix
-    // Update COMMON_TYPES in TransactionFilterProxyWhen when adding a new type
+    // Update COMMON_TYPES in TransactionFilterProxy when adding a new type

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
Copy link

coderabbitai bot commented Feb 15, 2026

Walkthrough

The changes introduce support for displaying and filtering OP_RETURN (data) transactions across the Qt wallet interface. A new DataTransaction enum value is added to the transaction type system. Transaction decomposition logic is updated to categorize unspendable OP_RETURN outputs as DataTransaction instead of treating them as standard sends. Supporting infrastructure is added to display these transactions in the transaction table with appropriate labels, enable filtering by this new type, and render OP_RETURN payload data in transaction details. A transaction type bitmask constant is also updated to reflect the new categorization.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 30.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding support for reporting OP_RETURN payloads as Data Transactions in the Qt UI.
Description check ✅ Passed The description is related to the changeset, explaining the work-in-progress nature and context around displaying OP_RETURN payloads as Data Transactions for better proposal fee clarity.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into develop

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
src/qt/transactiondesc.cpp (2)

299-320: Payload display merges all data pushes into a single hex blob.

When an OP_RETURN output has multiple data pushes (e.g., OP_RETURN <push1> <push2>), all push data is concatenated into a single hex string. This loses the boundary between separate pushes, which could make it harder to interpret multi-field OP_RETURN payloads (e.g., governance proposals with distinct fields).

Consider displaying each push separately or adding a delimiter, though for the current use case (proposal fee), this is likely acceptable.


316-318: HTML-escaped output is safe but consider labeling per-output when multiple OP_RETURN outputs exist.

If a transaction has multiple OP_RETURN outputs, each gets a "Payload:" line with no way to distinguish which vout it belongs to. Consider adding the output index for clarity.

💡 Optional: include output index
-                strHTML += "<b>" + tr("Payload") + ":</b> " + QString::fromStdString(HexStr(payload)) + "<br>";
+                strHTML += "<b>" + tr("Payload") + " (" + QString::number(&txout - &wtx.tx->vout[0]) + ")" + ":</b> " + QString::fromStdString(HexStr(payload)) + "<br>";

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.

@UdjinM6
Copy link

UdjinM6 commented Feb 15, 2026

nvm

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