-
Notifications
You must be signed in to change notification settings - Fork 38
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
BlockHeader algod v2 misses documentation #19
Comments
I'd like to pick this one up, I think I'll need a bit more info to start on this though. This is the Which I believe correlates to this struct in the algod messages module: algonaut/algonaut_client/src/algod/v2/message.rs Lines 650 to 667 in b8d19c6
I've tried to line these fields up side by side but it reveals that I'm not sure exactly how to map them to each other:
I'd like to check in and confirm if I'm on the right track and to ask if you could provide any further guidance on how to proceed. |
Hi @epequeno ! Yes, it's quite tricky to find documentation about this one. The current struct is defined starting from a test call towards the API, which makes it a very poor solution. We don't know which fields are optional and which are not for instance. Your reference seems to be the best source I am able to find. Another source comes from an automatic implementation of the client based on the Open API Schema that suggests the following implementation for the API response (completely avoiding the problem): #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct InlineResponse2001 {
/// Block header data.
#[serde(rename = "block")]
pub block: serde_json::Value,
/// Optional certificate object. This is only included when the format is set to message pack.
#[serde(rename = "cert", skip_serializing_if = "Option::is_none")]
pub cert: Option<serde_json::Value>,
} If we are not able to find solid docs this solution might be the less error-prone. |
Add documentation to the fields composing
BlockHeader
struct plus check which are optional and correct the type signature.The text was updated successfully, but these errors were encountered: