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