-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: add /pools/retiring endpoint #96
Conversation
…eate-retiring-endpoint
modules/spo_state/src/state.rs
Outdated
@@ -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>> { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that makes sense. 👍🏼
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Looks great - just one pernickity question about returning an Option<> but happy to merge if you don't agree |
…ot Option and improve response handling
…eate-retiring-endpoint
- Updated handle_spo function to also handle requests for retiring pools. - Removed direct handling of retiring pools from the main REST request handling.
Summary
This PR adds
/pools/retiring
endpoint to get all pools which will be retired in upcoming epochs.Changes
/pools/retiring
endpoint tospo_state
module'sspo
rest handler.PoolRetirement
schema.get_retiring_pools
function.Related Issue
#95