Skip to content

Commit

Permalink
Add utxoCostPerByte parameter.
Browse files Browse the repository at this point in the history
  • Loading branch information
newhoggy committed Jul 8, 2022
1 parent e73bb43 commit 7193afe
Show file tree
Hide file tree
Showing 10 changed files with 107 additions and 66 deletions.
4 changes: 2 additions & 2 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-ledger
tag: 0913292b13963ae4b60136eddb8d18b137f96a21
--sha256: 19rrnvvplvg8v989bcv6vpjwvblfa0m65izxkcp8dclf0a914qq3
tag: 65292694de72f137e6b90c5f361ae7646b48775f
--sha256: 05m1c7v8a2797675gkagpzl6bcjnj7w6lnx5x7hf90847ap88b05
subdir:
eras/alonzo/impl
eras/alonzo/test-suite
Expand Down
2 changes: 2 additions & 0 deletions cardano-api/gen/Gen/Cardano/Api/Typed.hs
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,7 @@ genProtocolParameters =
<*> Gen.maybe genNat
<*> Gen.maybe genNat
<*> Gen.maybe genNat
<*> Gen.maybe genLovelace

genProtocolParametersUpdate :: Gen ProtocolParametersUpdate
genProtocolParametersUpdate = do
Expand Down Expand Up @@ -795,6 +796,7 @@ genProtocolParametersUpdate = do
protocolUpdateMaxValueSize <- Gen.maybe genNat
protocolUpdateCollateralPercent <- Gen.maybe genNat
protocolUpdateMaxCollateralInputs <- Gen.maybe genNat
protocolUpdateUTxOCostPerByte <- Gen.maybe genLovelace
pure ProtocolParametersUpdate{..}


Expand Down
11 changes: 0 additions & 11 deletions cardano-api/src/Cardano/Api/Fees.hs
Original file line number Diff line number Diff line change
Expand Up @@ -793,10 +793,6 @@ data TxBodyErrorAutoBalance =
-- parameter, for eras that use this parameter.
| TxBodyErrorMissingParamMinUTxO

-- | The 'ProtocolParameters' must provide the value for the cost per
-- word parameter, for eras that use this parameter.
| TxBodyErrorMissingParamCostPerWord

-- | The transaction validity interval is too far into the future.
-- See 'TransactionValidityIntervalError' for details.
| TxBodyErrorValidityInterval TransactionValidityError
Expand Down Expand Up @@ -856,9 +852,6 @@ instance Error TxBodyErrorAutoBalance where
displayError TxBodyErrorMissingParamMinUTxO =
"The minUTxOValue protocol parameter is required but missing"

displayError TxBodyErrorMissingParamCostPerWord =
"The utxoCostPerWord protocol parameter is required but missing"

displayError (TxBodyErrorValidityInterval err) =
displayError err

Expand Down Expand Up @@ -1259,13 +1252,9 @@ calculateMinimumUTxO era txout@(TxOut _ v _ _) pparams' =

data MinimumUTxOError =
PParamsMinUTxOMissing
| PParamsUTxOCostPerWordMissing
deriving Show

instance Error MinimumUTxOError where
displayError PParamsMinUTxOMissing =
"\"minUtxoValue\" field not present in protocol parameters when \
\trying to calculate minimum UTxO value."
displayError PParamsUTxOCostPerWordMissing =
"\"utxoCostPerWord\" field not present in protocol parameters when \
\trying to calculate minimum UTxO value."
Loading

0 comments on commit 7193afe

Please sign in to comment.