-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plutus cost model: validate sizes in genesis files #724
base: master
Are you sure you want to change the base?
Conversation
e7abb54
to
82c6d28
Compare
82c6d28
to
6632c4c
Compare
, protocolUpdateUTxOCostPerByte = Nothing | ||
} | ||
where | ||
mCostModels :: Maybe (Plutus.CostModels) |
Check warning
Code scanning / HLint
Redundant bracket Warning
Found:
(Plutus.CostModels)
Perhaps:
Plutus.CostModels
costModels :: Either | ||
CostModelNotEnoughParametersError | ||
(Maybe (Map AnyPlutusScriptVersion CostModel)) | ||
costModels = sequence $ fromAlonzoCostModels <$> mCostModels |
Check warning
Code scanning / HLint
Use mapM Warning
Found:
sequence $ fromAlonzoCostModels <$> mCostModels
Perhaps:
mapM fromAlonzoCostModels mCostModels
(\(Ledger.ProtVer a b) -> (Ledger.getVersion a, b)) | ||
<$> strictMaybeToMaybe (ppu ^. ppuProtocolVersionL) | ||
} | ||
(fromAlonzoCommonPParamsUpdate ppu) <&> \ppu' -> |
Check notice
Code scanning / HLint
Redundant bracket Note
Found:
(fromAlonzoCommonPParamsUpdate ppu)
<&>
\\ ppu'
-> ppu'
{protocolUpdateProtocolVersion = (\\ (Ledger.ProtVer a b)
-> (Ledger.getVersion a, b))
<$> strictMaybeToMaybe (ppu ^. ppuProtocolVersionL)}
Perhaps:
fromAlonzoCommonPParamsUpdate ppu
<&>
\\ ppu'
-> ppu'
{protocolUpdateProtocolVersion = (\\ (Ledger.ProtVer a b)
-> (Ledger.getVersion a, b))
<$> strictMaybeToMaybe (ppu ^. ppuProtocolVersionL)}
(fromAlonzoCommonPParamsUpdate ppu) | ||
{ protocolUpdateUTxOCostPerByte = unCoinPerByte <$> strictMaybeToMaybe (ppu ^. ppuCoinsPerUTxOByteL) | ||
} | ||
(fromAlonzoCommonPParamsUpdate ppu) <&> \ppu' -> |
Check notice
Code scanning / HLint
Redundant bracket Note
Found:
(fromAlonzoCommonPParamsUpdate ppu)
<&>
\\ ppu'
-> ppu'
{protocolUpdateUTxOCostPerByte = unCoinPerByte
<$> strictMaybeToMaybe (ppu ^. ppuCoinsPerUTxOByteL)}
Perhaps:
fromAlonzoCommonPParamsUpdate ppu
<&>
\\ ppu'
-> ppu'
{protocolUpdateUTxOCostPerByte = unCoinPerByte
<$> strictMaybeToMaybe (ppu ^. ppuCoinsPerUTxOByteL)}
(\(Ledger.ProtVer a b) -> (Ledger.getVersion a, b)) | ||
<$> strictMaybeToMaybe (ppu ^. ppuProtocolVersionL) | ||
} | ||
(fromBabbageCommonPParamsUpdate ppu) <&> \ppu' -> |
Check notice
Code scanning / HLint
Redundant bracket Note
Found:
(fromBabbageCommonPParamsUpdate ppu)
<&>
\\ ppu'
-> ppu'
{protocolUpdateProtocolVersion = (\\ (Ledger.ProtVer a b)
-> (Ledger.getVersion a, b))
<$> strictMaybeToMaybe (ppu ^. ppuProtocolVersionL)}
Perhaps:
fromBabbageCommonPParamsUpdate ppu
<&>
\\ ppu'
-> ppu'
{protocolUpdateProtocolVersion = (\\ (Ledger.ProtVer a b)
-> (Ledger.getVersion a, b))
<$> strictMaybeToMaybe (ppu ^. ppuProtocolVersionL)}
(fromAlonzoPParams pp) | ||
{ protocolParamUTxOCostPerByte = Just . unCoinPerWord $ pp ^. ppCoinsPerUTxOWordL | ||
} | ||
(fromAlonzoPParams pp) <&> \pp' -> |
Check notice
Code scanning / HLint
Redundant bracket Note
Found:
(fromAlonzoPParams pp)
<&>
\\ pp'
-> pp'
{protocolParamUTxOCostPerByte = Just . unCoinPerWord
$ pp ^. ppCoinsPerUTxOWordL}
Perhaps:
fromAlonzoPParams pp
<&>
\\ pp'
-> pp'
{protocolParamUTxOCostPerByte = Just . unCoinPerWord
$ pp ^. ppCoinsPerUTxOWordL}
{ protocolParamUTxOCostPerByte = Just . unCoinPerByte $ pp ^. ppCoinsPerUTxOByteL | ||
, protocolParamDecentralization = Nothing | ||
} | ||
(fromAlonzoPParams pp) <&> \pp' -> |
Check notice
Code scanning / HLint
Redundant bracket Note
Found:
(fromAlonzoPParams pp)
<&>
\\ pp'
-> pp'
{protocolParamUTxOCostPerByte = Just . unCoinPerByte
$ pp ^. ppCoinsPerUTxOByteL,
protocolParamDecentralization = Nothing}
Perhaps:
fromAlonzoPParams pp
<&>
\\ pp'
-> pp'
{protocolParamUTxOCostPerByte = Just . unCoinPerByte
$ pp ^. ppCoinsPerUTxOByteL,
protocolParamDecentralization = Nothing}
3d6de33
to
dc0d52b
Compare
dc0d52b
to
bb8f66f
Compare
maybeFromLedgerTxUpdateProposal sbe body = | ||
caseShelleyToBabbageOrConwayEraOnwards | ||
( \w -> | ||
case body ^. L.updateTxBodyL of | ||
SNothing -> TxUpdateProposalNone | ||
SJust p -> TxUpdateProposal w (fromLedgerUpdate sbe p) | ||
SNothing -> pure TxUpdateProposalNone |
Check notice
Code scanning / HLint
Redundant bracket Note
Found:
TxUpdateProposal w <$> (fromLedgerUpdate sbe p)
Perhaps:
TxUpdateProposal w <$> fromLedgerUpdate sbe p
bb8f66f
to
2a1154b
Compare
@@ -1051,6 +1054,40 @@ toAlonzoCostModel (CostModel m) l = first (PpceInvalidCostModel (CostModel m)) $ | |||
fromAlonzoCostModel :: Alonzo.CostModel -> CostModel | |||
fromAlonzoCostModel m = CostModel $ Alonzo.getCostModelParams m | |||
|
|||
validateCostModelSize |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use validateCostModel?
Changelog
Context
API part of IntersectMBO/cardano-cli#928
How to trust this PR
TBD
Checklist