Skip to content

feat(key-wallet-ffi): expose version 3 provider payouts and share scripts - #1260

Merged
xdustinface merged 1 commit into
devfrom
pasta/ffi-provider-payouts
Nov 1, 2026
Merged

xdustinface merged 1 commit into
devfrom
pasta/ffi-provider-payouts

Conversation

@PastaPastaPasta

@PastaPastaPasta PastaPastaPasta commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

From version 3 (DIP-0026), a ProRegTx and a ProUpRegTx carry their owner payouts in a payouts list, and script_payout is empty. key-wallet-ffi's typed payload views only exposed script_payout, so an FFI consumer saw no payout at all for a version 3 registration. It also couldn't see a shared registration's collateral shares, or a ProUpShareTx: that type had only the discriminant (11) and no typed view.

This adds:

  • payouts / payouts_count (script + reward in basis points) on FFIProviderRegistrationPayload and FFIProviderUpdateRegistrarPayload;
  • on FFIProviderRegistrationPayload, has_shared_collateral (Dash Core's IsShared: at least one share), the shares (amount, refund script, reward script, owner key hash) and the early-leave terms;
  • FFIProviderUpdateSharePayload (pro_tx_hash, share index, reward script), pointed to by a new provider_update_share on FFISpecialTransactionPayload.

New fields are appended after the existing ones, so existing field offsets don't change. As with the existing scripts, every array and script is owned by its struct and freed with the transaction record. Empty scripts and lists are null with a zero length.

Tested with new unit tests for a version 3 ProRegTx with payouts and two shares, a decoded single-owner version 3 ProRegTx (not shared), a version 3 ProUpRegTx, and a ProUpShareTx, plus null checks on the legacy payload; the key-wallet-ffi suite passes.

🤖 Generated with Claude Code

PR Hygiene · 9313f62

  • Bots — coderabbitai skipped after its own rate limit
  • Self-review — posted; again after any push
  • Build green
  • Approvals
    • files with no dedicated owner (CHANGELOG.md, key-wallet-ffi/src/special_payload.rs) — approved by xdustinface

When every merge requirement is met, the PR Hygiene check passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.

…ipts

From version 3 (DIP-0026) a ProRegTx and ProUpRegTx carry their owner
payouts in `payouts` and leave `script_payout` empty, so the typed
payload views showed no payout. They now expose the payouts, a shared
registration's collateral shares and terms, and a typed ProUpShareTx
view. New fields are appended; existing field offsets are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 37 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between c374c77 and 9313f62.

Files selected for processing: 2
  • CHANGELOG.md
  • key-wallet-ffi/src/special_payload.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Waiting for bot review — coderabbitai not yet. Wait for the missing reviews, or a writer can post /skip-bots to proceed without them; blocking findings still need addressing.
Full checklist in the description.

@github-actions github-actions Bot added the waiting-bots Waiting for the review bots to report on this head label Nov 1, 2026
@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Bots are done — your move: post /self-reviewed.
Full checklist in the description.

@github-actions github-actions Bot added waiting-self-review Waiting for the author to post /self-reviewed bot-review-skipped A required review bot did not report; it was skipped by the window or by a person. and removed waiting-bots Waiting for the review bots to report on this head labels Nov 1, 2026
@codecov

codecov Bot commented Nov 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.03846% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.59%. Comparing base (c374c77) to head (9313f62).
⚠️ Report is 1 commits behind head on dev.

Files with missing lines Patch % Lines
key-wallet-ffi/src/special_payload.rs 99.03% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1260      +/-   ##
==========================================
+ Coverage   80.50%   80.59%   +0.08%     
==========================================
  Files         291      291              
  Lines       77463    77663     +200     
==========================================
+ Hits        62364    62590     +226     
+ Misses      15099    15073      -26     
Flag Coverage Δ
core 78.21% <ø> (ø)
ffi 58.20% <99.03%> (+1.20%) ⬆️
rpc 52.05% <ø> (ø)
spv 93.75% <ø> (+0.03%) ⬆️
wallet 82.57% <ø> (ø)
Files with missing lines Coverage Δ
key-wallet-ffi/src/special_payload.rs 99.58% <99.03%> (+6.98%) ⬆️

... and 4 files with indirect coverage changes

@PastaPastaPasta

Copy link
Copy Markdown
Member Author

/self-reviewed

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Policy satisfied — this can merge.
Full checklist in the description.

@github-actions github-actions Bot removed the waiting-self-review Waiting for the author to post /self-reviewed label Nov 1, 2026
@xdustinface
xdustinface merged commit 39384d0 into dev Nov 1, 2026
39 checks passed
@xdustinface
xdustinface deleted the pasta/ffi-provider-payouts branch November 1, 2026 04:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot-review-skipped A required review bot did not report; it was skipped by the window or by a person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants