Skip to content

feat: add /pools/retiring endpoint #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

golddydev
Copy link
Collaborator

@golddydev golddydev commented Jul 24, 2025

Summary

This PR adds /pools/retiring endpoint to get all pools which will be retired in upcoming epochs.

Changes

  • Add /pools/retiring endpoint to spo_state module's spo rest handler.
  • Add corresponding OpenAPI spec with PoolRetirement schema.
  • Add unit tests for get_retiring_pools function.

Related Issue

#95

@@ -114,6 +114,24 @@ impl State {
self.current().map(|state| state.spos.iter().collect())
}

/// Get pools that will be retired in the upcoming epochs
pub fn get_retiring_pools(&self) -> Option<Vec<PoolRetirement>> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering why this is an Option<> - feels like that's an implementation detail and it could return a (definite) empty Vec if there aren't any?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that makes sense. 👍🏼

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sandtreader
Copy link
Collaborator

Nice! Looks great - just one pernickity question about returning an Option<> but happy to merge if you don't agree

@golddydev golddydev requested a review from sandtreader July 24, 2025 17:56
- Updated handle_spo function to also handle requests for retiring pools.
- Removed direct handling of retiring pools from the main REST request handling.
@golddydev golddydev changed the title feat: add /pools_retiring endpoint feat: add /pools/retiring endpoint Jul 28, 2025
@sandtreader sandtreader merged commit 5d47d5a into input-output-hk:main Jul 28, 2025
2 checks passed
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