feat(minibf): implement /epochs/{number}/stakes/{pool_id} endpoint (#1101) - #1154
feat(minibf): implement /epochs/{number}/stakes/{pool_id} endpoint (#1101)#1154mmahut wants to merge 1 commit into
/epochs/{number}/stakes/{pool_id} endpoint (#1101)#1154Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
dd12c0c to
d4b274f
Compare
There was a problem hiding this comment.
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_poolhandler to scan epoch stake logs and filter rows bypool_id. - Register the new route in the Axum router and add endpoint documentation.
- Expose
decode_pool_idwithin 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)?; |
Implements
/epochs/{number}/stakes/{pool_id}(#1101).Same scan as
/epochs/{number}/stakesin 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.