Skip to content

feat(minibf): governance proposals withdrawals - #1279

Open
vladimirvolek wants to merge 1 commit into
mainfrom
minibf-governance-proposals-withdrawals
Open

feat(minibf): governance proposals withdrawals#1279
vladimirvolek wants to merge 1 commit into
mainfrom
minibf-governance-proposals-withdrawals

Conversation

@vladimirvolek

@vladimirvolek vladimirvolek commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

New tests:

resolves: #1117
resolves: #1113

Summary by CodeRabbit

  • New Features

    • Added endpoints to retrieve treasury withdrawals for governance proposals by transaction hash and certificate index, or by governance action ID.
    • Added pagination support for withdrawal results.
    • Added validation with clear HTTP 400 responses for invalid proposal identifiers.
  • Documentation

    • Updated the MiniBF API coverage documentation to include the new withdrawal endpoints.

@vladimirvolek
vladimirvolek requested review from a team and scarmuega as code owners August 30, 2026 14:10
@vladimirvolek vladimirvolek self-assigned this Aug 30, 2026
@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 12f249d5-c680-4dd9-b6ba-e953e463cca1

📥 Commits

Reviewing files that changed from the base of the PR and between e7973d4 and 82a1d1b.

📒 Files selected for processing (5)
  • crates/minibf/src/error.rs
  • crates/minibf/src/lib.rs
  • crates/minibf/src/mapping.rs
  • crates/minibf/src/routes/governance.rs
  • docs/content/apis/minibf.mdx

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

Adds two MiniBF governance withdrawal endpoints. The implementation parses proposal identifiers, reads treasury withdrawals, applies pagination, maps stake credentials to addresses, returns validation errors, registers routes, adds tests, and updates endpoint documentation.

Changes

Governance proposal withdrawals

Layer / File(s) Summary
Withdrawal identifiers and errors
crates/minibf/src/error.rs, crates/minibf/src/mapping.rs
Adds validation errors for certificate indexes and governance action IDs. Adds CIP-129 governance action ID parsing.
Withdrawal retrieval and validation
crates/minibf/src/routes/governance.rs
Reads proposal state, extracts treasury withdrawals, applies ordering and pagination, maps stake credentials to addresses, and tests success, empty, invalid, and internal-error responses.
Route registration and API coverage
crates/minibf/src/lib.rs, docs/content/apis/minibf.mdx
Registers both withdrawal endpoints and adds them to the MiniBF endpoint coverage table.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Merge Risk: ⚪ Minimal · up to 82a1d

This PR adds read-only governance withdrawal endpoints without an identified correctness, security, availability, or deployment risk; it is merge-ready after normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant Router
  participant GovernanceHandlers
  participant StateStore
  Client->>Router: GET withdrawal endpoint
  Router->>GovernanceHandlers: dispatch withdrawal handler
  GovernanceHandlers->>StateStore: read ProposalState
  StateStore-->>GovernanceHandlers: return proposal state
  GovernanceHandlers-->>Client: return paginated withdrawal JSON
Loading

Suggested reviewers: scarmuega, slowbackspace

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 73.91% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 23 functions across 4 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding governance proposal withdrawal support to MiniBF.
Full details: Docstring Coverage

Explanation

Docstring coverage is 73.91% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 23 functions across 4 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch minibf-governance-proposals-withdrawals

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.

@michalrus

Copy link
Copy Markdown
Contributor

@vladimirvolek cargo fmt is failing on CI, which uses +nightly 🙏

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.

minibf: add /governance/proposals/{gov_action_id}/withdrawals minibf: add /governance/proposals/{tx_hash}/{cert_index}/withdrawals

2 participants