Skip to main content

blockfrost_openapi/models/
genesis_content.rs

1use crate::models;
2use serde::{Deserialize, Serialize};
3
4#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
5pub struct GenesisContent {
6    /// The proportion of slots in which blocks should be issued
7    #[serde(rename = "active_slots_coefficient")]
8    pub active_slots_coefficient: f64,
9    /// Determines the quorum needed for votes on the protocol parameter updates
10    #[serde(rename = "update_quorum")]
11    pub update_quorum: i32,
12    /// The total number of lovelace in the system
13    #[serde(rename = "max_lovelace_supply")]
14    pub max_lovelace_supply: String,
15    /// Network identifier
16    #[serde(rename = "network_magic")]
17    pub network_magic: i32,
18    /// Number of slots in an epoch
19    #[serde(rename = "epoch_length")]
20    pub epoch_length: i32,
21    /// Time of slot 0 in UNIX time
22    #[serde(rename = "system_start")]
23    pub system_start: i32,
24    /// Number of slots in an KES period
25    #[serde(rename = "slots_per_kes_period")]
26    pub slots_per_kes_period: i32,
27    /// Duration of one slot in seconds
28    #[serde(rename = "slot_length")]
29    pub slot_length: i32,
30    /// The maximum number of time a KES key can be evolved before a pool operator must create a new operational certificate
31    #[serde(rename = "max_kes_evolutions")]
32    pub max_kes_evolutions: i32,
33    /// Security parameter k
34    #[serde(rename = "security_param")]
35    pub security_param: i32,
36}
37
38impl GenesisContent {
39    pub fn new(active_slots_coefficient: f64, update_quorum: i32, max_lovelace_supply: String, network_magic: i32, epoch_length: i32, system_start: i32, slots_per_kes_period: i32, slot_length: i32, max_kes_evolutions: i32, security_param: i32) -> GenesisContent {
40        GenesisContent {
41            active_slots_coefficient,
42            update_quorum,
43            max_lovelace_supply,
44            network_magic,
45            epoch_length,
46            system_start,
47            slots_per_kes_period,
48            slot_length,
49            max_kes_evolutions,
50            security_param,
51        }
52    }
53}
54