@@ -97,40 +97,67 @@ mod tests {
97
97
98
98
#[ tokio:: test]
99
99
async fn test_epochs_latest_parameters ( ) {
100
- let json_value = json ! ( {
101
- "epoch" : 225 ,
102
- "min_fee_a" : 44 ,
103
- "min_fee_b" : 155381 ,
104
- "max_block_size" : 65536 ,
105
- "max_tx_size" : 16384 ,
106
- "max_block_header_size" : 1100 ,
107
- "key_deposit" : "2000000" ,
108
- "pool_deposit" : "500000000" ,
109
- "e_max" : 18 ,
110
- "n_opt" : 150 ,
111
- "a0" : 0.3 ,
112
- "rho" : 0.003 ,
113
- "tau" : 0.2 ,
114
- "decentralisation_param" : 0.5 ,
115
- "extra_entropy" : null,
116
- "protocol_major_ver" : 2 ,
117
- "protocol_minor_ver" : 0 ,
118
- "min_utxo" : "1000000" ,
119
- "min_pool_cost" : "340000000" ,
120
- "nonce" : "1a3be38bcbb7911969283716ad7aa550250226b76a61fc51cc9a9a35d9276d81" ,
121
- "price_mem" : 0.001 ,
122
- "price_step" : 0.01 ,
123
- "max_tx_ex_mem" : "11000000000" ,
124
- "max_tx_ex_steps" : "11000000000" ,
125
- "max_block_ex_mem" : "110000000000" ,
126
- "max_block_ex_steps" : "110000000000" ,
127
- "max_val_size" : "5000" ,
128
- "collateral_percent" : 15 ,
129
- "max_collateral_inputs" : 6 ,
130
- "coins_per_utxo_word" : "34482" ,
131
- "cost_models" : null,
132
- "coins_per_utxo_size" : "34482"
133
- } ) ;
100
+ // not building with `json!` macro because this payload is too big
101
+ let mut json_value = serde_json:: Map :: new ( ) ;
102
+ json_value. insert ( "epoch" . to_string ( ) , json ! ( 225 ) ) ;
103
+ json_value. insert ( "min_fee_a" . to_string ( ) , json ! ( 44 ) ) ;
104
+ json_value. insert ( "min_fee_b" . to_string ( ) , json ! ( 155381 ) ) ;
105
+ json_value. insert ( "max_block_size" . to_string ( ) , json ! ( 65536 ) ) ;
106
+ json_value. insert ( "max_tx_size" . to_string ( ) , json ! ( 16384 ) ) ;
107
+ json_value. insert ( "max_block_header_size" . to_string ( ) , json ! ( 1100 ) ) ;
108
+ json_value. insert ( "key_deposit" . to_string ( ) , json ! ( "2000000" ) ) ;
109
+ json_value. insert ( "pool_deposit" . to_string ( ) , json ! ( "500000000" ) ) ;
110
+ json_value. insert ( "e_max" . to_string ( ) , json ! ( 18 ) ) ;
111
+ json_value. insert ( "n_opt" . to_string ( ) , json ! ( 150 ) ) ;
112
+ json_value. insert ( "a0" . to_string ( ) , json ! ( 0.3 ) ) ;
113
+ json_value. insert ( "rho" . to_string ( ) , json ! ( 0.003 ) ) ;
114
+ json_value. insert ( "tau" . to_string ( ) , json ! ( 0.2 ) ) ;
115
+ json_value. insert ( "decentralisation_param" . to_string ( ) , json ! ( 0.5 ) ) ;
116
+ json_value. insert ( "extra_entropy" . to_string ( ) , json ! ( null) ) ;
117
+ json_value. insert ( "protocol_major_ver" . to_string ( ) , json ! ( 2 ) ) ;
118
+ json_value. insert ( "protocol_minor_ver" . to_string ( ) , json ! ( 0 ) ) ;
119
+ json_value. insert ( "min_utxo" . to_string ( ) , json ! ( "1000000" ) ) ;
120
+ json_value. insert ( "min_pool_cost" . to_string ( ) , json ! ( "340000000" ) ) ;
121
+ json_value. insert (
122
+ "nonce" . to_string ( ) ,
123
+ json ! ( "1a3be38bcbb7911969283716ad7aa550250226b76a61fc51cc9a9a35d9276d81" ) ,
124
+ ) ;
125
+ json_value. insert ( "price_mem" . to_string ( ) , json ! ( 0.001 ) ) ;
126
+ json_value. insert ( "price_step" . to_string ( ) , json ! ( 0.01 ) ) ;
127
+ json_value. insert ( "max_tx_ex_mem" . to_string ( ) , json ! ( "11000000000" ) ) ;
128
+ json_value. insert ( "max_tx_ex_steps" . to_string ( ) , json ! ( "11000000000" ) ) ;
129
+ json_value. insert ( "max_block_ex_mem" . to_string ( ) , json ! ( "110000000000" ) ) ;
130
+ json_value. insert ( "max_block_ex_steps" . to_string ( ) , json ! ( "110000000000" ) ) ;
131
+ json_value. insert ( "max_val_size" . to_string ( ) , json ! ( "5000" ) ) ;
132
+ json_value. insert ( "collateral_percent" . to_string ( ) , json ! ( 15 ) ) ;
133
+ json_value. insert ( "max_collateral_inputs" . to_string ( ) , json ! ( 6 ) ) ;
134
+ json_value. insert ( "coins_per_utxo_word" . to_string ( ) , json ! ( "34482" ) ) ;
135
+ json_value. insert ( "cost_models" . to_string ( ) , json ! ( null) ) ;
136
+ json_value. insert ( "coins_per_utxo_size" . to_string ( ) , json ! ( "34482" ) ) ;
137
+ json_value. insert ( "pvt_motion_no_confidence" . to_string ( ) , json ! ( null) ) ;
138
+ json_value. insert ( "pvt_committee_normal" . to_string ( ) , json ! ( null) ) ;
139
+ json_value. insert ( "pvt_committee_no_confidence" . to_string ( ) , json ! ( null) ) ;
140
+ json_value. insert ( "pvt_hard_fork_initiation" . to_string ( ) , json ! ( null) ) ;
141
+ json_value. insert ( "dvt_motion_no_confidence" . to_string ( ) , json ! ( null) ) ;
142
+ json_value. insert ( "dvt_committee_normal" . to_string ( ) , json ! ( null) ) ;
143
+ json_value. insert ( "dvt_committee_no_confidence" . to_string ( ) , json ! ( null) ) ;
144
+ json_value. insert ( "dvt_update_to_constitution" . to_string ( ) , json ! ( null) ) ;
145
+ json_value. insert ( "dvt_hard_fork_initiation" . to_string ( ) , json ! ( null) ) ;
146
+ json_value. insert ( "dvt_p_p_network_group" . to_string ( ) , json ! ( null) ) ;
147
+ json_value. insert ( "dvt_p_p_economic_group" . to_string ( ) , json ! ( null) ) ;
148
+ json_value. insert ( "dvt_p_p_technical_group" . to_string ( ) , json ! ( null) ) ;
149
+ json_value. insert ( "dvt_p_p_gov_group" . to_string ( ) , json ! ( null) ) ;
150
+ json_value. insert ( "dvt_treasury_withdrawal" . to_string ( ) , json ! ( null) ) ;
151
+ json_value. insert ( "committee_min_size" . to_string ( ) , json ! ( null) ) ;
152
+ json_value. insert ( "committee_max_term_length" . to_string ( ) , json ! ( null) ) ;
153
+ json_value. insert ( "gov_action_lifetime" . to_string ( ) , json ! ( null) ) ;
154
+ json_value. insert ( "gov_action_deposit" . to_string ( ) , json ! ( null) ) ;
155
+ json_value. insert ( "drep_deposit" . to_string ( ) , json ! ( null) ) ;
156
+ json_value. insert ( "drep_activity" . to_string ( ) , json ! ( null) ) ;
157
+ json_value. insert ( "pvtpp_security_group" . to_string ( ) , json ! ( null) ) ;
158
+ json_value. insert ( "pvt_p_p_security_group" . to_string ( ) , json ! ( null) ) ;
159
+ json_value. insert ( "min_fee_ref_script_cost_per_byte" . to_string ( ) , json ! ( null) ) ;
160
+ let json_value = serde_json:: Value :: Object ( json_value) ;
134
161
135
162
serde_json:: from_value :: < EpochParamContent > ( json_value) . unwrap ( ) ;
136
163
}
0 commit comments