Skip to content

Commit

Permalink
add minFeeRefScriptCostPerByte to create-protocol-param-update + bump…
Browse files Browse the repository at this point in the history
… cardano-api

Signed-off-by: Carlos LopezDeLara <carlos.lopezdelara@iohk.io>
  • Loading branch information
CarlosLopezDeLara committed Apr 25, 2024
1 parent 61647dd commit 2360183
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 8 deletions.
5 changes: 2 additions & 3 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ repository cardano-haskell-packages
-- you need to run if you change them
index-state:
, hackage.haskell.org 2024-04-15T08:36:34Z
, cardano-haskell-packages 2024-04-15T08:36:34Z

, cardano-haskell-packages 2024-04-24T22:24:37Z
packages:
cardano-cli

Expand All @@ -40,4 +39,4 @@ write-ghc-environment-files: always

-- IMPORTANT
-- Do NOT add more source-repository-package stanzas here unless they are strictly
-- temporary! Please read the section in CONTRIBUTING about updating dependencies.
-- temporary! Please read the section in CONTRIBUTING about updating dependencies.
2 changes: 1 addition & 1 deletion cardano-cli/cardano-cli.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ library
, binary
, bytestring
, canonical-json
, cardano-api ^>= 8.45.0.0
, cardano-api ^>= 8.45.1.0
, cardano-binary
, cardano-crypto
, cardano-crypto-class ^>= 2.1.2
Expand Down
2 changes: 1 addition & 1 deletion cardano-cli/src/Cardano/CLI/EraBased/Options/Common.hs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ import GHC.Natural (Natural)
import Network.Socket (PortNumber)
import Options.Applicative hiding (help, str)
import qualified Options.Applicative as Opt
import qualified Text.Parsec as Parsec
import Text.Parsec ((<?>))
import qualified Text.Parsec as Parsec
import qualified Text.Parsec.Error as Parsec
import qualified Text.Parsec.Language as Parsec
import qualified Text.Parsec.String as Parsec
Expand Down
11 changes: 11 additions & 0 deletions cardano-cli/src/Cardano/CLI/EraBased/Options/Governance/Actions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import Cardano.Api.Shelley
import qualified Cardano.CLI.EraBased.Commands.Governance.Actions as Cmd
import Cardano.CLI.EraBased.Options.Common
import Cardano.CLI.Types.Common
import Cardano.CLI.Parser

import Data.Foldable
import GHC.Natural (Natural)
Expand Down Expand Up @@ -218,6 +219,13 @@ pGovernanceActionProtocolParametersUpdateCmd era = do
pure $ Cmd.GovernanceActionProtocolParametersUpdateCmd
<$> pUpdateProtocolParametersCmd w

pMinFeeRefScriptCostPerByte :: Parser L.NonNegativeInterval
pMinFeeRefScriptCostPerByte =
Opt.option (toNonNegativeIntervalOrErr <$> readRational) $ mconcat
[ Opt.long "ref-script-cost-per-byte"
, Opt.metavar "RATIONAL"
, Opt.help "Reference script cost per byte for free calculation"
]

convertToLedger :: (a -> b) -> Parser (Maybe a) -> Parser (L.StrictMaybe b)
convertToLedger conv = fmap (L.maybeToStrictMaybe . fmap conv)
Expand Down Expand Up @@ -299,6 +307,7 @@ pIntroducedInConwayPParams =
<*> convertToLedger id (optional pNewGovActionDeposit)
<*> convertToLedger id (optional pDRepDeposit)
<*> convertToLedger id (optional pDRepActivity)
<*> convertToLedger id (optional pMinFeeRefScriptCostPerByte)

-- Not necessary in Conway era onwards
pProtocolParametersUpdateGenesisKeys :: Parser [VerificationKeyFile In]
Expand Down Expand Up @@ -375,3 +384,5 @@ pNetwork = asum $ mconcat
]
]
]


1 change: 1 addition & 0 deletions cardano-cli/test/cardano-cli-golden/files/golden/help.cli
Original file line number Diff line number Diff line change
Expand Up @@ -6419,6 +6419,7 @@ Usage: cardano-cli conway governance action create-protocol-parameters-update
[--new-governance-action-deposit NATURAL]
[--drep-deposit LOVELACE]
[--drep-activity WORD32]
[--ref-script-cost-per-byte RATIONAL]
[--cost-model-file FILE]
--out-file FILE

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ Usage: cardano-cli conway governance action create-protocol-parameters-update
[--new-governance-action-deposit NATURAL]
[--drep-deposit LOVELACE]
[--drep-activity WORD32]
[--ref-script-cost-per-byte RATIONAL]
[--cost-model-file FILE]
--out-file FILE

Expand Down Expand Up @@ -196,6 +197,8 @@ Available options:
a governance action.
--drep-deposit LOVELACE DRep deposit amount.
--drep-activity WORD32 DRep activity period, in epochs.
--ref-script-cost-per-byte RATIONAL
Reference script cost per byte for free calculation
--cost-model-file FILE Filepath of the JSON formatted cost model
--out-file FILE The output file.
-h,--help Show this help text
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2360183

Please sign in to comment.