1use cml_chain::{address::RewardAccount, certs::StakeCredential, crypto::GenesisHash};
5use cml_core::serialization::{LenEncoding, StringEncoding};
6use std::collections::BTreeMap;
7
8#[derive(Clone, Debug, Default)]
9pub struct GenesisKeyDelegationEncoding {
10 pub len_encoding: LenEncoding,
11 pub tag_encoding: Option<cbor_event::Sz>,
12 pub genesis_hash_encoding: StringEncoding,
13 pub genesis_delegate_hash_encoding: StringEncoding,
14 pub vrf_key_hash_encoding: StringEncoding,
15}
16
17#[derive(Clone, Debug, Default)]
18pub struct MultisigAllEncoding {
19 pub len_encoding: LenEncoding,
20 pub tag_encoding: Option<cbor_event::Sz>,
21 pub multisig_scripts_encoding: LenEncoding,
22}
23
24#[derive(Clone, Debug, Default)]
25pub struct MultisigAnyEncoding {
26 pub len_encoding: LenEncoding,
27 pub tag_encoding: Option<cbor_event::Sz>,
28 pub multisig_scripts_encoding: LenEncoding,
29}
30
31#[derive(Clone, Debug, Default)]
32pub struct MultisigNOfKEncoding {
33 pub len_encoding: LenEncoding,
34 pub tag_encoding: Option<cbor_event::Sz>,
35 pub n_encoding: Option<cbor_event::Sz>,
36 pub multisig_scripts_encoding: LenEncoding,
37}
38
39#[derive(Clone, Debug, Default)]
40pub struct MultisigPubkeyEncoding {
41 pub len_encoding: LenEncoding,
42 pub tag_encoding: Option<cbor_event::Sz>,
43 pub ed25519_key_hash_encoding: StringEncoding,
44}
45
46#[derive(Clone, Debug, Default)]
47pub struct ProtocolVersionStructEncoding {
48 pub len_encoding: LenEncoding,
49}
50
51#[derive(Clone, Debug, Default)]
52pub struct ShelleyBlockEncoding {
53 pub len_encoding: LenEncoding,
54 pub transaction_bodies_encoding: LenEncoding,
55 pub transaction_witness_sets_encoding: LenEncoding,
56 pub transaction_metadata_set_encoding: LenEncoding,
57 pub transaction_metadata_set_key_encodings: BTreeMap<u16, Option<cbor_event::Sz>>,
58}
59
60#[derive(Clone, Debug, Default)]
61pub struct ShelleyDNSNameEncoding {
62 pub inner_encoding: StringEncoding,
63}
64
65#[derive(Clone, Debug, Default)]
66pub struct ShelleyHeaderBodyEncoding {
67 pub len_encoding: LenEncoding,
68 pub block_number_encoding: Option<cbor_event::Sz>,
69 pub slot_encoding: Option<cbor_event::Sz>,
70 pub prev_hash_encoding: StringEncoding,
71 pub issuer_vkey_encoding: StringEncoding,
72 pub vrf_vkey_encoding: StringEncoding,
73 pub block_body_size_encoding: Option<cbor_event::Sz>,
74 pub block_body_hash_encoding: StringEncoding,
75}
76
77#[derive(Clone, Debug, Default)]
78pub struct ShelleyHeaderEncoding {
79 pub len_encoding: LenEncoding,
80}
81
82#[derive(Clone, Debug, Default)]
83pub struct ShelleyMoveInstantaneousRewardEncoding {
84 pub len_encoding: LenEncoding,
85 pub pot_encoding: Option<cbor_event::Sz>,
86 pub to_stake_credentials_encoding: LenEncoding,
87 pub to_stake_credentials_value_encodings: BTreeMap<StakeCredential, Option<cbor_event::Sz>>,
88}
89
90#[derive(Clone, Debug, Default)]
91pub struct ShelleyMoveInstantaneousRewardsCertEncoding {
92 pub len_encoding: LenEncoding,
93 pub tag_encoding: Option<cbor_event::Sz>,
94}
95
96#[derive(Clone, Debug, Default)]
97pub struct ShelleyMultiHostNameEncoding {
98 pub len_encoding: LenEncoding,
99 pub tag_encoding: Option<cbor_event::Sz>,
100}
101
102#[derive(Clone, Debug, Default)]
103pub struct ShelleyPoolParamsEncoding {
104 pub len_encoding: LenEncoding,
105 pub operator_encoding: StringEncoding,
106 pub vrf_keyhash_encoding: StringEncoding,
107 pub pledge_encoding: Option<cbor_event::Sz>,
108 pub cost_encoding: Option<cbor_event::Sz>,
109 pub pool_owners_encoding: LenEncoding,
110 pub pool_owners_elem_encodings: Vec<StringEncoding>,
111 pub relays_encoding: LenEncoding,
112}
113
114#[derive(Clone, Debug, Default)]
115pub struct ShelleyPoolRegistrationEncoding {
116 pub len_encoding: LenEncoding,
117 pub tag_encoding: Option<cbor_event::Sz>,
118}
119
120#[derive(Clone, Debug, Default)]
121pub struct ShelleyProtocolParamUpdateEncoding {
122 pub len_encoding: LenEncoding,
123 pub orig_deser_order: Vec<usize>,
124 pub minfee_a_encoding: Option<cbor_event::Sz>,
125 pub minfee_a_key_encoding: Option<cbor_event::Sz>,
126 pub minfee_b_encoding: Option<cbor_event::Sz>,
127 pub minfee_b_key_encoding: Option<cbor_event::Sz>,
128 pub max_block_body_size_encoding: Option<cbor_event::Sz>,
129 pub max_block_body_size_key_encoding: Option<cbor_event::Sz>,
130 pub max_transaction_size_encoding: Option<cbor_event::Sz>,
131 pub max_transaction_size_key_encoding: Option<cbor_event::Sz>,
132 pub max_block_header_size_encoding: Option<cbor_event::Sz>,
133 pub max_block_header_size_key_encoding: Option<cbor_event::Sz>,
134 pub key_deposit_encoding: Option<cbor_event::Sz>,
135 pub key_deposit_key_encoding: Option<cbor_event::Sz>,
136 pub pool_deposit_encoding: Option<cbor_event::Sz>,
137 pub pool_deposit_key_encoding: Option<cbor_event::Sz>,
138 pub maximum_epoch_encoding: Option<cbor_event::Sz>,
139 pub maximum_epoch_key_encoding: Option<cbor_event::Sz>,
140 pub n_opt_encoding: Option<cbor_event::Sz>,
141 pub n_opt_key_encoding: Option<cbor_event::Sz>,
142 pub pool_pledge_influence_key_encoding: Option<cbor_event::Sz>,
143 pub expansion_rate_key_encoding: Option<cbor_event::Sz>,
144 pub treasury_growth_rate_key_encoding: Option<cbor_event::Sz>,
145 pub decentralization_constant_key_encoding: Option<cbor_event::Sz>,
146 pub extra_entropy_key_encoding: Option<cbor_event::Sz>,
147 pub protocol_version_key_encoding: Option<cbor_event::Sz>,
148 pub min_utxo_value_encoding: Option<cbor_event::Sz>,
149 pub min_utxo_value_key_encoding: Option<cbor_event::Sz>,
150}
151
152#[derive(Clone, Debug, Default)]
153pub struct ShelleySingleHostNameEncoding {
154 pub len_encoding: LenEncoding,
155 pub tag_encoding: Option<cbor_event::Sz>,
156 pub port_encoding: Option<cbor_event::Sz>,
157}
158
159#[derive(Clone, Debug, Default)]
160pub struct ShelleyTransactionBodyEncoding {
161 pub len_encoding: LenEncoding,
162 pub orig_deser_order: Vec<usize>,
163 pub inputs_encoding: LenEncoding,
164 pub inputs_key_encoding: Option<cbor_event::Sz>,
165 pub outputs_encoding: LenEncoding,
166 pub outputs_key_encoding: Option<cbor_event::Sz>,
167 pub fee_encoding: Option<cbor_event::Sz>,
168 pub fee_key_encoding: Option<cbor_event::Sz>,
169 pub ttl_encoding: Option<cbor_event::Sz>,
170 pub ttl_key_encoding: Option<cbor_event::Sz>,
171 pub certs_encoding: LenEncoding,
172 pub certs_key_encoding: Option<cbor_event::Sz>,
173 pub withdrawals_encoding: LenEncoding,
174 pub withdrawals_value_encodings: BTreeMap<RewardAccount, Option<cbor_event::Sz>>,
175 pub withdrawals_key_encoding: Option<cbor_event::Sz>,
176 pub update_key_encoding: Option<cbor_event::Sz>,
177 pub auxiliary_data_hash_encoding: StringEncoding,
178 pub auxiliary_data_hash_key_encoding: Option<cbor_event::Sz>,
179}
180
181#[derive(Clone, Debug, Default)]
182pub struct ShelleyTransactionEncoding {
183 pub len_encoding: LenEncoding,
184}
185
186#[derive(Clone, Debug, Default)]
187pub struct ShelleyTransactionOutputEncoding {
188 pub len_encoding: LenEncoding,
189 pub amount_encoding: Option<cbor_event::Sz>,
190}
191
192#[derive(Clone, Debug, Default)]
193pub struct ShelleyTransactionWitnessSetEncoding {
194 pub len_encoding: LenEncoding,
195 pub orig_deser_order: Vec<usize>,
196 pub vkeywitnesses_encoding: LenEncoding,
197 pub vkeywitnesses_key_encoding: Option<cbor_event::Sz>,
198 pub native_scripts_encoding: LenEncoding,
199 pub native_scripts_key_encoding: Option<cbor_event::Sz>,
200 pub bootstrap_witnesses_encoding: LenEncoding,
201 pub bootstrap_witnesses_key_encoding: Option<cbor_event::Sz>,
202}
203
204#[derive(Clone, Debug, Default)]
205pub struct ShelleyUpdateEncoding {
206 pub len_encoding: LenEncoding,
207 pub shelley_proposed_protocol_parameter_updates_encoding: LenEncoding,
208 pub shelley_proposed_protocol_parameter_updates_key_encodings:
209 BTreeMap<GenesisHash, StringEncoding>,
210 pub epoch_encoding: Option<cbor_event::Sz>,
211}