Skip to content

feat(minibf): implement /epochs/{number}/stakes/{pool_id} endpoint (#1101) - #1154

Open
mmahut wants to merge 1 commit into
mmahut/epoch-stakesfrom
mmahut/epoch-pool-stakes
Open

feat(minibf): implement /epochs/{number}/stakes/{pool_id} endpoint (#1101)#1154
mmahut wants to merge 1 commit into
mmahut/epoch-stakesfrom
mmahut/epoch-pool-stakes

Conversation

@mmahut

@mmahut mmahut commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Implements /epochs/{number}/stakes/{pool_id} (#1101).

Same scan as /epochs/{number}/stakes in the base PR, filtered by pool. The pool lives in the log value rather than the key (keeping per-account history a point read), so this endpoint scans the epoch and filters.

Verified against hosted Blockfrost on preview.

@mmahut
mmahut requested a review from scarmuega as a code owner July 31, 2026 22:43
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6e0d9169-40dd-4d0e-8be8-8fe187a2682a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)

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.

@mmahut
mmahut force-pushed the mmahut/epoch-pool-stakes branch from dd12c0c to d4b274f Compare July 31, 2026 22:45

Copilot AI 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.

Pull request overview

Adds the Blockfrost-compatible GET /epochs/{epoch}/stakes/{pool_id} endpoint to the minibf service, extending the existing epoch stake distribution scan with a pool filter (matching the current AccountStakeLog storage layout where pool_id is in the log value).

Changes:

  • Implement by_number_stakes_pool handler to scan epoch stake logs and filter rows by pool_id.
  • Register the new route in the Axum router and add endpoint documentation.
  • Expose decode_pool_id within the crate and add tests for happy-path + error cases + pagination.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
docs/content/apis/minibf.mdx Documents the newly supported endpoint in the minibf API list.
crates/minibf/src/routes/pools.rs Makes decode_pool_id available for reuse by other route modules.
crates/minibf/src/routes/epochs/mod.rs Adds the new pool-scoped epoch stakes handler plus comprehensive tests.
crates/minibf/src/lib.rs Registers /epochs/{epoch}/stakes/{pool_id} in the router.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

where
Option<PoolState>: From<D::Entity>,
{
let pagination = Pagination::try_from(params)?;
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