14
14
import rest .koios .client .backend .api .epoch .model .EpochParams ;
15
15
16
16
import java .math .BigDecimal ;
17
+ import java .math .BigInteger ;
17
18
import java .util .*;
18
19
import java .util .concurrent .atomic .AtomicInteger ;
19
20
@@ -178,6 +179,42 @@ private Result<ProtocolParams> convertToProtocolParams(EpochParams epochParams)
178
179
if (epochParams .getCoinsPerUtxoSize () != null ) {
179
180
protocolParams .setCoinsPerUtxoSize (epochParams .getCoinsPerUtxoSize ());
180
181
}
182
+ if (epochParams .getDvtPPNetworkGroup () != null ) {
183
+ protocolParams .setDvtPPNetworkGroup (epochParams .getDvtPPNetworkGroup ());
184
+ }
185
+ if (epochParams .getDvtPPEconomicGroup () != null ) {
186
+ protocolParams .setDvtPPEconomicGroup (epochParams .getDvtPPEconomicGroup ());
187
+ }
188
+ if (epochParams .getDvtPPTechnicalGroup () != null ) {
189
+ protocolParams .setDvtPPTechnicalGroup (epochParams .getDvtPPTechnicalGroup ());
190
+ }
191
+ if (epochParams .getDvtPPGovGroup () != null ) {
192
+ protocolParams .setDvtPPGovGroup (epochParams .getDvtPPGovGroup ());
193
+ }
194
+ if (epochParams .getDvtTreasuryWithdrawal () != null ) {
195
+ protocolParams .setDvtTreasuryWithdrawal (epochParams .getDvtTreasuryWithdrawal ());
196
+ }
197
+ if (epochParams .getCommitteeMinSize () != null ) {
198
+ protocolParams .setCommitteeMinSize (epochParams .getCommitteeMinSize ());
199
+ }
200
+ if (epochParams .getCommitteeMaxTermLength () != null ) {
201
+ protocolParams .setCommitteeMaxTermLength (epochParams .getCommitteeMaxTermLength ());
202
+ }
203
+ if (epochParams .getGovActionLifetime () != null ) {
204
+ protocolParams .setGovActionLifetime (epochParams .getGovActionLifetime ());
205
+ }
206
+ if (epochParams .getGovActionDeposit () != null ) {
207
+ protocolParams .setGovActionDeposit (new BigInteger (epochParams .getGovActionDeposit ()));
208
+ }
209
+ if (epochParams .getDrepDeposit () != null ) {
210
+ protocolParams .setDrepDeposit (new BigInteger (epochParams .getDrepDeposit ()));
211
+ }
212
+ if (epochParams .getDrepActivity () != null ) {
213
+ protocolParams .setDrepActivity (epochParams .getDrepActivity ());
214
+ }
215
+ if (epochParams .getMinFeeRefScriptCostPerByte () != null ) {
216
+ protocolParams .setMinFeeRefScriptCostPerByte (epochParams .getMinFeeRefScriptCostPerByte ());
217
+ }
181
218
return Result .success ("OK" ).withValue (protocolParams ).code (200 );
182
219
}
183
220
@@ -197,6 +234,8 @@ private Map<String, Map<String, Long>> convertToCostModels(JsonNode costModelsJs
197
234
Map <String , Long > plutusV1CostModelsMap = new HashMap <>();
198
235
final AtomicInteger plutusV2IndexHolder = new AtomicInteger ();
199
236
Map <String , Long > plutusV2CostModelsMap = new HashMap <>();
237
+ final AtomicInteger plutusV3IndexHolder = new AtomicInteger ();
238
+ Map <String , Long > plutusV3CostModelsMap = new HashMap <>();
200
239
result .forEach ((key , value ) -> {
201
240
if (key .equals ("PlutusV1" )) {
202
241
value .forEach (aLong -> {
@@ -211,6 +250,13 @@ private Map<String, Map<String, Long>> convertToCostModels(JsonNode costModelsJs
211
250
});
212
251
res .put (key , plutusV2CostModelsMap );
213
252
}
253
+ // else if (key.equals("PlutusV3")) {
254
+ // value.forEach(aLong -> {
255
+ // final int index = plutusV3IndexHolder.getAndIncrement();
256
+ // plutusV3CostModelsMap.put(PlutusOps.getOperations(3).get(index), aLong);
257
+ // });
258
+ // res.put(key, plutusV3CostModelsMap);
259
+ // } TODO Uncomment after adding V3_OPS
214
260
});
215
261
} catch (JsonProcessingException ignored ) {}
216
262
return res ;
0 commit comments