diff --git a/modules/api/src/main/scala/io/ergolabs/cardano/explorer/api/v1/models/ProtocolParams.scala b/modules/api/src/main/scala/io/ergolabs/cardano/explorer/api/v1/models/ProtocolParams.scala index a5db1c6..6fb7806 100644 --- a/modules/api/src/main/scala/io/ergolabs/cardano/explorer/api/v1/models/ProtocolParams.scala +++ b/modules/api/src/main/scala/io/ergolabs/cardano/explorer/api/v1/models/ProtocolParams.scala @@ -25,6 +25,7 @@ final case class ProtocolParams( poolPledgeInfluence: Double, monetaryExpansion: Double, treasuryCut: Double, + coinsPerUtxoByte: Option[Long], utxoCostPerWord: Option[Long], costModels: Map[String, Map[String, Long]], executionUnitPrices: ExecutionUnitPrices, @@ -39,31 +40,33 @@ object ProtocolParams { implicit val schema: Schema[ProtocolParams] = Schema.derived[ProtocolParams] - def fromEpochParams(epochParams: EpochParams, costModelsMap: Map[String, Map[String, Long]]): ProtocolParams = ProtocolParams( - protocolVersion = ProtocolVersion(epochParams.majorVersion, epochParams.minorVersion), - decentralization = epochParams.decentralization, - extraPraosEntropy = epochParams.extraEntropy, - maxBlockHeaderSize = epochParams.maxBlockHeaderSize, - maxBlockBodySize = epochParams.maxBlockSize, - maxTxSize = epochParams.maxTxSize, - txFeeFixed = epochParams.txFeeFixed, - txFeePerByte = epochParams.txFeePerByte, - minUTxOValue = epochParams.minUtxoValue, - stakeAddressDeposit = epochParams.keyDeposit, - stakePoolDeposit = epochParams.poolDeposit, - minPoolCost = epochParams.minPoolCost, - poolRetireMaxEpoch = epochParams.maxEpoch, - stakePoolTargetNum = epochParams.optimalPoolCount, - poolPledgeInfluence = epochParams.influence, - monetaryExpansion = epochParams.monetaryExpansion, - treasuryCut = epochParams.treasuryGrowthRate, - utxoCostPerWord = epochParams.costPerSize, - costModels = costModelsMap, - executionUnitPrices = ExecutionUnitPrices(epochParams.priceStep, epochParams.priceMemory), - maxTxExecutionUnits = ExecutionUnits(epochParams.maxTxExSteps, epochParams.maxTxExMem), - maxBlockExecutionUnits = ExecutionUnits(epochParams.maxBlockExSteps, epochParams.maxBlockExMem), - maxValueSize = epochParams.maxValSize, - collateralPercentage = epochParams.collateralPercent, - maxCollateralInputs = epochParams.maxCollateralInputs - ) + def fromEpochParams(epochParams: EpochParams, costModelsMap: Map[String, Map[String, Long]]): ProtocolParams = + ProtocolParams( + protocolVersion = ProtocolVersion(epochParams.majorVersion, epochParams.minorVersion), + decentralization = epochParams.decentralization, + extraPraosEntropy = epochParams.extraEntropy, + maxBlockHeaderSize = epochParams.maxBlockHeaderSize, + maxBlockBodySize = epochParams.maxBlockSize, + maxTxSize = epochParams.maxTxSize, + txFeeFixed = epochParams.txFeeFixed, + txFeePerByte = epochParams.txFeePerByte, + minUTxOValue = epochParams.minUtxoValue, + stakeAddressDeposit = epochParams.keyDeposit, + stakePoolDeposit = epochParams.poolDeposit, + minPoolCost = epochParams.minPoolCost, + poolRetireMaxEpoch = epochParams.maxEpoch, + stakePoolTargetNum = epochParams.optimalPoolCount, + poolPledgeInfluence = epochParams.influence, + monetaryExpansion = epochParams.monetaryExpansion, + treasuryCut = epochParams.treasuryGrowthRate, + coinsPerUtxoByte = epochParams.coinsPerUtxoByte, + utxoCostPerWord = epochParams.coinsPerUtxoByte, + costModels = costModelsMap, + executionUnitPrices = ExecutionUnitPrices(epochParams.priceStep, epochParams.priceMemory), + maxTxExecutionUnits = ExecutionUnits(epochParams.maxTxExSteps, epochParams.maxTxExMem), + maxBlockExecutionUnits = ExecutionUnits(epochParams.maxBlockExSteps, epochParams.maxBlockExMem), + maxValueSize = epochParams.maxValSize, + collateralPercentage = epochParams.collateralPercent, + maxCollateralInputs = epochParams.maxCollateralInputs + ) } diff --git a/modules/core/src/main/scala/io/ergolabs/cardano/explorer/core/db/models/EpochParams.scala b/modules/core/src/main/scala/io/ergolabs/cardano/explorer/core/db/models/EpochParams.scala index bb71f71..0af7049 100644 --- a/modules/core/src/main/scala/io/ergolabs/cardano/explorer/core/db/models/EpochParams.scala +++ b/modules/core/src/main/scala/io/ergolabs/cardano/explorer/core/db/models/EpochParams.scala @@ -20,7 +20,7 @@ final case class EpochParams( influence: Double, monetaryExpansion: Double, treasuryGrowthRate: Double, - costPerSize: Option[Long], + coinsPerUtxoByte: Option[Long], costModelId: Int, priceStep: Option[Double], priceMemory: Option[Double], diff --git a/modules/core/src/main/scala/io/ergolabs/cardano/explorer/core/db/sql/OutputsSql.scala b/modules/core/src/main/scala/io/ergolabs/cardano/explorer/core/db/sql/OutputsSql.scala index d9a7789..653d62c 100644 --- a/modules/core/src/main/scala/io/ergolabs/cardano/explorer/core/db/sql/OutputsSql.scala +++ b/modules/core/src/main/scala/io/ergolabs/cardano/explorer/core/db/sql/OutputsSql.scala @@ -55,7 +55,7 @@ final class OutputsSql(implicit lh: LogHandler) { | o.value, | encode(o.data_hash, 'hex'), | d.value, - | else encode(d.bytes, 'hex'), + | encode(d.bytes, 'hex'), | i.id, | encode(ti.hash, 'hex'), | encode(s.hash, 'hex') diff --git a/project/Dependencies.scala b/project/Dependencies.scala index f4b07b6..487c3d0 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -71,3 +71,4 @@ object Dependencies { ) } } +