From 36465f09d7ad8b72cb427a7335a3609709d773ab Mon Sep 17 00:00:00 2001 From: Satya Date: Sun, 19 May 2024 12:35:44 +0800 Subject: [PATCH] fix: Change minFeeRefScriptCostPerByte from BigInteger to BigDecimal (node 8.11.0) --- .../bloxbean/cardano/yaci/core/model/ProtocolParamUpdate.java | 2 +- .../cardano/yaci/core/model/serializers/UpdateSerializer.java | 2 +- .../localstate/queries/CurrentProtocolParamsQuery.java | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/com/bloxbean/cardano/yaci/core/model/ProtocolParamUpdate.java b/core/src/main/java/com/bloxbean/cardano/yaci/core/model/ProtocolParamUpdate.java index f795b6d..dd71d86 100644 --- a/core/src/main/java/com/bloxbean/cardano/yaci/core/model/ProtocolParamUpdate.java +++ b/core/src/main/java/com/bloxbean/cardano/yaci/core/model/ProtocolParamUpdate.java @@ -74,5 +74,5 @@ public class ProtocolParamUpdate { private BigInteger govActionDeposit; //30 private BigInteger drepDeposit; //31 private Integer drepActivity; //32 - private Integer minFeeRefScriptCostPerByte; //33 + private BigDecimal minFeeRefScriptCostPerByte; //33 } diff --git a/core/src/main/java/com/bloxbean/cardano/yaci/core/model/serializers/UpdateSerializer.java b/core/src/main/java/com/bloxbean/cardano/yaci/core/model/serializers/UpdateSerializer.java index cd44638..a19b0ae 100644 --- a/core/src/main/java/com/bloxbean/cardano/yaci/core/model/serializers/UpdateSerializer.java +++ b/core/src/main/java/com/bloxbean/cardano/yaci/core/model/serializers/UpdateSerializer.java @@ -208,7 +208,7 @@ public ProtocolParamUpdate getProtocolParams(Map genesisProtocolParamsMap) { Integer drepInactivityPeriod = itemDI != null ? toInt(itemDI) : null; itemDI = genesisProtocolParamsMap.get(new UnsignedInteger(33)); - Integer minFeeRefScriptCostPerByte = itemDI != null ? toInt(itemDI) : null; + BigDecimal minFeeRefScriptCostPerByte = itemDI != null ? toRationalNumber(itemDI) : null; ProtocolParamUpdate protocolParamUpdate = ProtocolParamUpdate.builder() .minFeeA(minFeeA) diff --git a/core/src/main/java/com/bloxbean/cardano/yaci/core/protocol/localstate/queries/CurrentProtocolParamsQuery.java b/core/src/main/java/com/bloxbean/cardano/yaci/core/protocol/localstate/queries/CurrentProtocolParamsQuery.java index 8cf129b..a752fcd 100644 --- a/core/src/main/java/com/bloxbean/cardano/yaci/core/protocol/localstate/queries/CurrentProtocolParamsQuery.java +++ b/core/src/main/java/com/bloxbean/cardano/yaci/core/protocol/localstate/queries/CurrentProtocolParamsQuery.java @@ -422,10 +422,10 @@ public CurrentProtocolParamQueryResult deserializeResult(DataItem[] di) { itemDI = paramsDIList.get(29); Integer drepInactivityPeriod = itemDI != null ? toInt(itemDI) : null; - Integer minFeeRefScriptCostPerByte = null; //TODO -- Remove if condition once this is available in the node release + BigDecimal minFeeRefScriptCostPerByte = null; //TODO -- Remove if condition once this is available in the node release if (paramsDIList.size() > 30) { itemDI = paramsDIList.get(30); - minFeeRefScriptCostPerByte = itemDI != null ? toInt(itemDI) : null; + minFeeRefScriptCostPerByte = itemDI != null ? toRationalNumber(itemDI) : null; } ProtocolParamUpdate protocolParams = ProtocolParamUpdate.builder()