1use crate::models;
2use serde::{Deserialize, Serialize};
3
4#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
5pub struct ProposalParametersParameters {
6 #[serde(rename = "epoch", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
8 pub epoch: Option<Option<i32>>,
9 #[serde(rename = "min_fee_a", deserialize_with = "Option::deserialize")]
11 pub min_fee_a: Option<i32>,
12 #[serde(rename = "min_fee_b", deserialize_with = "Option::deserialize")]
14 pub min_fee_b: Option<i32>,
15 #[serde(rename = "max_block_size", deserialize_with = "Option::deserialize")]
17 pub max_block_size: Option<i32>,
18 #[serde(rename = "max_tx_size", deserialize_with = "Option::deserialize")]
20 pub max_tx_size: Option<i32>,
21 #[serde(rename = "max_block_header_size", deserialize_with = "Option::deserialize")]
23 pub max_block_header_size: Option<i32>,
24 #[serde(rename = "key_deposit", deserialize_with = "Option::deserialize")]
26 pub key_deposit: Option<String>,
27 #[serde(rename = "pool_deposit", deserialize_with = "Option::deserialize")]
29 pub pool_deposit: Option<String>,
30 #[serde(rename = "e_max", deserialize_with = "Option::deserialize")]
32 pub e_max: Option<i32>,
33 #[serde(rename = "n_opt", deserialize_with = "Option::deserialize")]
35 pub n_opt: Option<i32>,
36 #[serde(rename = "a0", deserialize_with = "Option::deserialize")]
38 pub a0: Option<f64>,
39 #[serde(rename = "rho", deserialize_with = "Option::deserialize")]
41 pub rho: Option<f64>,
42 #[serde(rename = "tau", deserialize_with = "Option::deserialize")]
44 pub tau: Option<f64>,
45 #[serde(rename = "decentralisation_param", deserialize_with = "Option::deserialize")]
47 pub decentralisation_param: Option<f64>,
48 #[serde(rename = "extra_entropy", deserialize_with = "Option::deserialize")]
50 pub extra_entropy: Option<String>,
51 #[serde(rename = "protocol_major_ver", deserialize_with = "Option::deserialize")]
53 pub protocol_major_ver: Option<i32>,
54 #[serde(rename = "protocol_minor_ver", deserialize_with = "Option::deserialize")]
56 pub protocol_minor_ver: Option<i32>,
57 #[serde(rename = "min_utxo", deserialize_with = "Option::deserialize")]
59 pub min_utxo: Option<String>,
60 #[serde(rename = "min_pool_cost", deserialize_with = "Option::deserialize")]
62 pub min_pool_cost: Option<String>,
63 #[serde(rename = "cost_models", deserialize_with = "Option::deserialize")]
65 pub cost_models: Option<std::collections::HashMap<String, serde_json::Value>>,
66 #[serde(rename = "price_mem", deserialize_with = "Option::deserialize")]
68 pub price_mem: Option<f64>,
69 #[serde(rename = "price_step", deserialize_with = "Option::deserialize")]
71 pub price_step: Option<f64>,
72 #[serde(rename = "max_tx_ex_mem", deserialize_with = "Option::deserialize")]
74 pub max_tx_ex_mem: Option<String>,
75 #[serde(rename = "max_tx_ex_steps", deserialize_with = "Option::deserialize")]
77 pub max_tx_ex_steps: Option<String>,
78 #[serde(rename = "max_block_ex_mem", deserialize_with = "Option::deserialize")]
80 pub max_block_ex_mem: Option<String>,
81 #[serde(rename = "max_block_ex_steps", deserialize_with = "Option::deserialize")]
83 pub max_block_ex_steps: Option<String>,
84 #[serde(rename = "max_val_size", deserialize_with = "Option::deserialize")]
86 pub max_val_size: Option<String>,
87 #[serde(rename = "collateral_percent", deserialize_with = "Option::deserialize")]
89 pub collateral_percent: Option<i32>,
90 #[serde(rename = "max_collateral_inputs", deserialize_with = "Option::deserialize")]
92 pub max_collateral_inputs: Option<i32>,
93 #[serde(rename = "coins_per_utxo_size", deserialize_with = "Option::deserialize")]
95 pub coins_per_utxo_size: Option<String>,
96 #[serde(rename = "coins_per_utxo_word", deserialize_with = "Option::deserialize")]
98 pub coins_per_utxo_word: Option<String>,
99 #[serde(rename = "pvt_motion_no_confidence", deserialize_with = "Option::deserialize")]
101 pub pvt_motion_no_confidence: Option<f64>,
102 #[serde(rename = "pvt_committee_normal", deserialize_with = "Option::deserialize")]
104 pub pvt_committee_normal: Option<f64>,
105 #[serde(rename = "pvt_committee_no_confidence", deserialize_with = "Option::deserialize")]
107 pub pvt_committee_no_confidence: Option<f64>,
108 #[serde(rename = "pvt_hard_fork_initiation", deserialize_with = "Option::deserialize")]
110 pub pvt_hard_fork_initiation: Option<f64>,
111 #[serde(rename = "dvt_motion_no_confidence", deserialize_with = "Option::deserialize")]
113 pub dvt_motion_no_confidence: Option<f64>,
114 #[serde(rename = "dvt_committee_normal", deserialize_with = "Option::deserialize")]
116 pub dvt_committee_normal: Option<f64>,
117 #[serde(rename = "dvt_committee_no_confidence", deserialize_with = "Option::deserialize")]
119 pub dvt_committee_no_confidence: Option<f64>,
120 #[serde(rename = "dvt_update_to_constitution", deserialize_with = "Option::deserialize")]
122 pub dvt_update_to_constitution: Option<f64>,
123 #[serde(rename = "dvt_hard_fork_initiation", deserialize_with = "Option::deserialize")]
125 pub dvt_hard_fork_initiation: Option<f64>,
126 #[serde(rename = "dvt_p_p_network_group", deserialize_with = "Option::deserialize")]
128 pub dvt_p_p_network_group: Option<f64>,
129 #[serde(rename = "dvt_p_p_economic_group", deserialize_with = "Option::deserialize")]
131 pub dvt_p_p_economic_group: Option<f64>,
132 #[serde(rename = "dvt_p_p_technical_group", deserialize_with = "Option::deserialize")]
134 pub dvt_p_p_technical_group: Option<f64>,
135 #[serde(rename = "dvt_p_p_gov_group", deserialize_with = "Option::deserialize")]
137 pub dvt_p_p_gov_group: Option<f64>,
138 #[serde(rename = "dvt_treasury_withdrawal", deserialize_with = "Option::deserialize")]
140 pub dvt_treasury_withdrawal: Option<f64>,
141 #[serde(rename = "committee_min_size", deserialize_with = "Option::deserialize")]
143 pub committee_min_size: Option<String>,
144 #[serde(rename = "committee_max_term_length", deserialize_with = "Option::deserialize")]
146 pub committee_max_term_length: Option<String>,
147 #[serde(rename = "gov_action_lifetime", deserialize_with = "Option::deserialize")]
149 pub gov_action_lifetime: Option<String>,
150 #[serde(rename = "gov_action_deposit", deserialize_with = "Option::deserialize")]
152 pub gov_action_deposit: Option<String>,
153 #[serde(rename = "drep_deposit", deserialize_with = "Option::deserialize")]
155 pub drep_deposit: Option<String>,
156 #[serde(rename = "drep_activity", deserialize_with = "Option::deserialize")]
158 pub drep_activity: Option<String>,
159 #[serde(rename = "pvtpp_security_group", deserialize_with = "Option::deserialize")]
161 pub pvtpp_security_group: Option<f64>,
162 #[serde(rename = "pvt_p_p_security_group", deserialize_with = "Option::deserialize")]
164 pub pvt_p_p_security_group: Option<f64>,
165 #[serde(rename = "min_fee_ref_script_cost_per_byte", deserialize_with = "Option::deserialize")]
166 pub min_fee_ref_script_cost_per_byte: Option<f64>,
167}
168
169impl ProposalParametersParameters {
170 pub fn new(min_fee_a: Option<i32>, min_fee_b: Option<i32>, max_block_size: Option<i32>, max_tx_size: Option<i32>, max_block_header_size: Option<i32>, key_deposit: Option<String>, pool_deposit: Option<String>, e_max: Option<i32>, n_opt: Option<i32>, a0: Option<f64>, rho: Option<f64>, tau: Option<f64>, decentralisation_param: Option<f64>, extra_entropy: Option<String>, protocol_major_ver: Option<i32>, protocol_minor_ver: Option<i32>, min_utxo: Option<String>, min_pool_cost: Option<String>, cost_models: Option<std::collections::HashMap<String, serde_json::Value>>, price_mem: Option<f64>, price_step: Option<f64>, max_tx_ex_mem: Option<String>, max_tx_ex_steps: Option<String>, max_block_ex_mem: Option<String>, max_block_ex_steps: Option<String>, max_val_size: Option<String>, collateral_percent: Option<i32>, max_collateral_inputs: Option<i32>, coins_per_utxo_size: Option<String>, coins_per_utxo_word: Option<String>, pvt_motion_no_confidence: Option<f64>, pvt_committee_normal: Option<f64>, pvt_committee_no_confidence: Option<f64>, pvt_hard_fork_initiation: Option<f64>, dvt_motion_no_confidence: Option<f64>, dvt_committee_normal: Option<f64>, dvt_committee_no_confidence: Option<f64>, dvt_update_to_constitution: Option<f64>, dvt_hard_fork_initiation: Option<f64>, dvt_p_p_network_group: Option<f64>, dvt_p_p_economic_group: Option<f64>, dvt_p_p_technical_group: Option<f64>, dvt_p_p_gov_group: Option<f64>, dvt_treasury_withdrawal: Option<f64>, committee_min_size: Option<String>, committee_max_term_length: Option<String>, gov_action_lifetime: Option<String>, gov_action_deposit: Option<String>, drep_deposit: Option<String>, drep_activity: Option<String>, pvtpp_security_group: Option<f64>, pvt_p_p_security_group: Option<f64>, min_fee_ref_script_cost_per_byte: Option<f64>) -> ProposalParametersParameters {
171 ProposalParametersParameters {
172 epoch: None,
173 min_fee_a,
174 min_fee_b,
175 max_block_size,
176 max_tx_size,
177 max_block_header_size,
178 key_deposit,
179 pool_deposit,
180 e_max,
181 n_opt,
182 a0,
183 rho,
184 tau,
185 decentralisation_param,
186 extra_entropy,
187 protocol_major_ver,
188 protocol_minor_ver,
189 min_utxo,
190 min_pool_cost,
191 cost_models,
192 price_mem,
193 price_step,
194 max_tx_ex_mem,
195 max_tx_ex_steps,
196 max_block_ex_mem,
197 max_block_ex_steps,
198 max_val_size,
199 collateral_percent,
200 max_collateral_inputs,
201 coins_per_utxo_size,
202 coins_per_utxo_word,
203 pvt_motion_no_confidence,
204 pvt_committee_normal,
205 pvt_committee_no_confidence,
206 pvt_hard_fork_initiation,
207 dvt_motion_no_confidence,
208 dvt_committee_normal,
209 dvt_committee_no_confidence,
210 dvt_update_to_constitution,
211 dvt_hard_fork_initiation,
212 dvt_p_p_network_group,
213 dvt_p_p_economic_group,
214 dvt_p_p_technical_group,
215 dvt_p_p_gov_group,
216 dvt_treasury_withdrawal,
217 committee_min_size,
218 committee_max_term_length,
219 gov_action_lifetime,
220 gov_action_deposit,
221 drep_deposit,
222 drep_activity,
223 pvtpp_security_group,
224 pvt_p_p_security_group,
225 min_fee_ref_script_cost_per_byte,
226 }
227 }
228}
229