Skip to main content

blockfrost_openapi/models/
protocol_message_parts.rs

1use crate::models;
2use serde::{Deserialize, Serialize};
3
4/// ProtocolMessageParts : ProtocolMessage represents a message that is signed (or verified) by the Mithril protocol
5#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
6pub struct ProtocolMessageParts {
7    /// Digest of the snapshot archive
8    #[serde(rename = "snapshot_digest", skip_serializing_if = "Option::is_none")]
9    pub snapshot_digest: Option<String>,
10    /// Aggregate verification key (AVK) that will be used to create the next multi signature
11    #[serde(rename = "next_aggregate_verification_key")]
12    pub next_aggregate_verification_key: String,
13    /// The latest signed block number
14    #[serde(rename = "latest_block_number", skip_serializing_if = "Option::is_none")]
15    pub latest_block_number: Option<String>,
16}
17
18impl ProtocolMessageParts {
19    /// ProtocolMessage represents a message that is signed (or verified) by the Mithril protocol
20    pub fn new(next_aggregate_verification_key: String) -> ProtocolMessageParts {
21        ProtocolMessageParts {
22            snapshot_digest: None,
23            next_aggregate_verification_key,
24            latest_block_number: None,
25        }
26    }
27}
28