Skip to main content

blockfrost_openapi/models/
mithril_stake_distribution_message.rs

1use crate::models;
2use serde::{Deserialize, Serialize};
3
4/// MithrilStakeDistributionMessage : This message represents a Mithril stake distribution.
5#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
6pub struct MithrilStakeDistributionMessage {
7    /// Cardano chain epoch number
8    #[serde(rename = "epoch")]
9    pub epoch: i64,
10    /// Hash of the Mithril stake distribution
11    #[serde(rename = "hash")]
12    pub hash: String,
13    /// Hash of the associated certificate
14    #[serde(rename = "certificate_hash", skip_serializing_if = "Option::is_none")]
15    pub certificate_hash: Option<String>,
16    /// The list of the signers with their stakes and verification keys
17    #[serde(rename = "signers")]
18    pub signers: Vec<models::SignerWithStake>,
19    /// Date and time of the entity creation
20    #[serde(rename = "created_at")]
21    pub created_at: String,
22    #[serde(rename = "protocol_parameters")]
23    pub protocol_parameters: models::ProtocolParameters,
24}
25
26impl MithrilStakeDistributionMessage {
27    /// This message represents a Mithril stake distribution.
28    pub fn new(epoch: i64, hash: String, signers: Vec<models::SignerWithStake>, created_at: String, protocol_parameters: models::ProtocolParameters) -> MithrilStakeDistributionMessage {
29        MithrilStakeDistributionMessage {
30            epoch,
31            hash,
32            certificate_hash: None,
33            signers,
34            created_at,
35            protocol_parameters,
36        }
37    }
38}
39