1use cml_chain::{address::RewardAccount, assets::AssetName, crypto::GenesisHash, PolicyId};
5use cml_core::serialization::{LenEncoding, StringEncoding};
6use std::collections::BTreeMap;
7
8#[derive(Clone, Debug, Default)]
9pub struct AlonzoBlockEncoding {
10 pub len_encoding: LenEncoding,
11 pub transaction_bodies_encoding: LenEncoding,
12 pub transaction_witness_sets_encoding: LenEncoding,
13 pub auxiliary_data_set_encoding: LenEncoding,
14 pub auxiliary_data_set_key_encodings: BTreeMap<u16, Option<cbor_event::Sz>>,
15 pub invalid_transactions_encoding: LenEncoding,
16 pub invalid_transactions_elem_encodings: Vec<Option<cbor_event::Sz>>,
17}
18
19#[derive(Clone, Debug, Default)]
20pub struct AlonzoFormatAuxDataEncoding {
21 pub len_encoding: LenEncoding,
22 pub tag_encoding: Option<cbor_event::Sz>,
23 pub orig_deser_order: Vec<usize>,
24 pub metadata_key_encoding: Option<cbor_event::Sz>,
25 pub native_scripts_encoding: LenEncoding,
26 pub native_scripts_key_encoding: Option<cbor_event::Sz>,
27 pub plutus_v1_scripts_encoding: LenEncoding,
28 pub plutus_v1_scripts_key_encoding: Option<cbor_event::Sz>,
29}
30
31#[derive(Clone, Debug, Default)]
32pub struct AlonzoProtocolParamUpdateEncoding {
33 pub len_encoding: LenEncoding,
34 pub orig_deser_order: Vec<usize>,
35 pub minfee_a_encoding: Option<cbor_event::Sz>,
36 pub minfee_a_key_encoding: Option<cbor_event::Sz>,
37 pub minfee_b_encoding: Option<cbor_event::Sz>,
38 pub minfee_b_key_encoding: Option<cbor_event::Sz>,
39 pub max_block_body_size_encoding: Option<cbor_event::Sz>,
40 pub max_block_body_size_key_encoding: Option<cbor_event::Sz>,
41 pub max_transaction_size_encoding: Option<cbor_event::Sz>,
42 pub max_transaction_size_key_encoding: Option<cbor_event::Sz>,
43 pub max_block_header_size_encoding: Option<cbor_event::Sz>,
44 pub max_block_header_size_key_encoding: Option<cbor_event::Sz>,
45 pub key_deposit_encoding: Option<cbor_event::Sz>,
46 pub key_deposit_key_encoding: Option<cbor_event::Sz>,
47 pub pool_deposit_encoding: Option<cbor_event::Sz>,
48 pub pool_deposit_key_encoding: Option<cbor_event::Sz>,
49 pub maximum_epoch_encoding: Option<cbor_event::Sz>,
50 pub maximum_epoch_key_encoding: Option<cbor_event::Sz>,
51 pub n_opt_encoding: Option<cbor_event::Sz>,
52 pub n_opt_key_encoding: Option<cbor_event::Sz>,
53 pub pool_pledge_influence_key_encoding: Option<cbor_event::Sz>,
54 pub expansion_rate_key_encoding: Option<cbor_event::Sz>,
55 pub treasury_growth_rate_key_encoding: Option<cbor_event::Sz>,
56 pub decentralization_constant_key_encoding: Option<cbor_event::Sz>,
57 pub extra_entropy_key_encoding: Option<cbor_event::Sz>,
58 pub protocol_version_key_encoding: Option<cbor_event::Sz>,
59 pub min_pool_cost_encoding: Option<cbor_event::Sz>,
60 pub min_pool_cost_key_encoding: Option<cbor_event::Sz>,
61 pub ada_per_utxo_byte_encoding: Option<cbor_event::Sz>,
62 pub ada_per_utxo_byte_key_encoding: Option<cbor_event::Sz>,
63 pub cost_models_for_script_languages_key_encoding: Option<cbor_event::Sz>,
64 pub execution_costs_key_encoding: Option<cbor_event::Sz>,
65 pub max_tx_ex_units_key_encoding: Option<cbor_event::Sz>,
66 pub max_block_ex_units_key_encoding: Option<cbor_event::Sz>,
67 pub max_value_size_encoding: Option<cbor_event::Sz>,
68 pub max_value_size_key_encoding: Option<cbor_event::Sz>,
69 pub collateral_percentage_encoding: Option<cbor_event::Sz>,
70 pub collateral_percentage_key_encoding: Option<cbor_event::Sz>,
71 pub max_collateral_inputs_encoding: Option<cbor_event::Sz>,
72 pub max_collateral_inputs_key_encoding: Option<cbor_event::Sz>,
73}
74
75#[derive(Clone, Debug, Default)]
76pub struct AlonzoRedeemerEncoding {
77 pub len_encoding: LenEncoding,
78 pub tag_encoding: Option<cbor_event::Sz>,
79 pub index_encoding: Option<cbor_event::Sz>,
80}
81
82#[derive(Clone, Debug, Default)]
83pub struct AlonzoTransactionBodyEncoding {
84 pub len_encoding: LenEncoding,
85 pub orig_deser_order: Vec<usize>,
86 pub inputs_encoding: LenEncoding,
87 pub inputs_key_encoding: Option<cbor_event::Sz>,
88 pub outputs_encoding: LenEncoding,
89 pub outputs_key_encoding: Option<cbor_event::Sz>,
90 pub fee_encoding: Option<cbor_event::Sz>,
91 pub fee_key_encoding: Option<cbor_event::Sz>,
92 pub ttl_encoding: Option<cbor_event::Sz>,
93 pub ttl_key_encoding: Option<cbor_event::Sz>,
94 pub certs_encoding: LenEncoding,
95 pub certs_key_encoding: Option<cbor_event::Sz>,
96 pub withdrawals_encoding: LenEncoding,
97 pub withdrawals_value_encodings: BTreeMap<RewardAccount, Option<cbor_event::Sz>>,
98 pub withdrawals_key_encoding: Option<cbor_event::Sz>,
99 pub update_key_encoding: Option<cbor_event::Sz>,
100 pub auxiliary_data_hash_encoding: StringEncoding,
101 pub auxiliary_data_hash_key_encoding: Option<cbor_event::Sz>,
102 pub validity_interval_start_encoding: Option<cbor_event::Sz>,
103 pub validity_interval_start_key_encoding: Option<cbor_event::Sz>,
104 pub mint_encoding: LenEncoding,
105 pub mint_key_encodings: BTreeMap<PolicyId, StringEncoding>,
106 pub mint_value_encodings:
107 BTreeMap<PolicyId, (LenEncoding, BTreeMap<AssetName, Option<cbor_event::Sz>>)>,
108 pub mint_key_encoding: Option<cbor_event::Sz>,
109 pub script_data_hash_encoding: StringEncoding,
110 pub script_data_hash_key_encoding: Option<cbor_event::Sz>,
111 pub collateral_inputs_encoding: LenEncoding,
112 pub collateral_inputs_key_encoding: Option<cbor_event::Sz>,
113 pub required_signers_encoding: LenEncoding,
114 pub required_signers_elem_encodings: Vec<StringEncoding>,
115 pub required_signers_key_encoding: Option<cbor_event::Sz>,
116 pub network_id_key_encoding: Option<cbor_event::Sz>,
117}
118
119#[derive(Clone, Debug, Default)]
120pub struct AlonzoTransactionEncoding {
121 pub len_encoding: LenEncoding,
122}
123
124#[derive(Clone, Debug, Default)]
125pub struct AlonzoTransactionWitnessSetEncoding {
126 pub len_encoding: LenEncoding,
127 pub orig_deser_order: Vec<usize>,
128 pub vkeywitnesses_encoding: LenEncoding,
129 pub vkeywitnesses_key_encoding: Option<cbor_event::Sz>,
130 pub native_scripts_encoding: LenEncoding,
131 pub native_scripts_key_encoding: Option<cbor_event::Sz>,
132 pub bootstrap_witnesses_encoding: LenEncoding,
133 pub bootstrap_witnesses_key_encoding: Option<cbor_event::Sz>,
134 pub plutus_v1_scripts_encoding: LenEncoding,
135 pub plutus_v1_scripts_key_encoding: Option<cbor_event::Sz>,
136 pub plutus_datums_encoding: LenEncoding,
137 pub plutus_datums_key_encoding: Option<cbor_event::Sz>,
138 pub redeemers_encoding: LenEncoding,
139 pub redeemers_key_encoding: Option<cbor_event::Sz>,
140}
141
142#[derive(Clone, Debug, Default)]
143pub struct AlonzoUpdateEncoding {
144 pub len_encoding: LenEncoding,
145 pub proposed_protocol_parameter_updates_encoding: LenEncoding,
146 pub proposed_protocol_parameter_updates_key_encodings: BTreeMap<GenesisHash, StringEncoding>,
147 pub epoch_encoding: Option<cbor_event::Sz>,
148}