-
Notifications
You must be signed in to change notification settings - Fork 2
feat: Add /governance/dreps/ endpoint handlers to rest_blockfrost #124
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
Signed-off-by: William Hankins <william@sundae.fi>
…ckfrost-endpoints
…8; 32] Signed-off-by: William Hankins <william@sundae.fi>
Signed-off-by: William Hankins <william@sundae.fi>
…ckfrost-endpoints
} | ||
}; | ||
|
||
let amount = (sum + response.info.deposit).to_string(); |
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.
It seems odd this should include deposit but I'm going to assume you have a BF spec that says so :-)
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.
This was a mistake on my end. Deposit removed from delegated amount in commit bbbfbfb.
&self, | ||
stake_keys: &[Vec<u8>], | ||
) -> Option<HashMap<Vec<u8>, u64>> { | ||
let accounts = self.stake_addresses.lock().unwrap(); |
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.
We need to consider whether it is the live stake or one of the snapshots here
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.
I'd like to see all StateQuery
requests include a block or epoch number so that we can guarantee the returned state is consistent for aggregated REST responses. Should this be addressed in this PR or as a follow-up?
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.
Let's do that as a followup
@@ -35,7 +35,7 @@ references: | |||
#[derive(Debug, Default, Clone, serde::Serialize, serde::Deserialize)] | |||
pub struct TxOutput { | |||
/// Tx hash | |||
pub tx_hash: Vec<u8>, | |||
pub tx_hash: TxHash, |
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 to see this tied down!
Signed-off-by: William Hankins <william@sundae.fi>
You've got conflicts from Eric's PR now (sorry) but ready to merge when fixed I think. |
Signed-off-by: William Hankins <william@sundae.fi>
This PR adds the following 6
/governance/dreps
endpoint handlers utilizing the recently expandeddrep_state
:/governance/dreps
: list all DReps/governance/dreps/{drep_id}
: return extended DRep info (retired/expired status, total delegation, etc.)./governance/dreps/{drep_id}/delegators
: list delegators and amounts./governance/dreps/{drep_id}/metadata
: return metadata info (anchor URL, hash, fetched JSON metadata)./governance/dreps/{drep_id}/updates
: list registration, update, and deregistration history./governance/dreps/{drep_id}/votes
: list votes with transaction hashes and cert indexes.Additional changes:
TxHash
type alias for[u8; 32]
in/common/types.rs
and replaced direct usages.