Skip to content
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

re-export Plutus' validateCostModelParams #2287

Merged
merged 1 commit into from
May 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions alonzo/impl/src/Cardano/Ledger/Alonzo/Scripts.hs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ module Cardano.Ledger.Alonzo.Scripts
alwaysSucceeds,
alwaysFails,
pointWiseExUnits,
validateCostModelParams,
)
where

Expand Down Expand Up @@ -70,7 +71,7 @@ import Data.Word (Word64, Word8)
import GHC.Generics (Generic)
import NoThunks.Class (InspectHeapNamed (..), NoThunks)
import Numeric.Natural (Natural)
import qualified Plutus.V1.Ledger.Api as Plutus (validateCostModelParams)
import Plutus.V1.Ledger.Api (validateCostModelParams)
import qualified Plutus.V1.Ledger.Examples as Plutus (alwaysFailingNAryFunction, alwaysSucceedingNAryFunction)
import Shelley.Spec.Ledger.Serialization (mapFromCBOR)

Expand Down Expand Up @@ -170,7 +171,7 @@ deriving instance ToCBOR CostModel

checkCostModel :: Map Text Integer -> Either String CostModel
checkCostModel cm =
if Plutus.validateCostModelParams cm
if validateCostModelParams cm
then Right (CostModel cm)
else Left ("Invalid cost model: " ++ show cm)

Expand Down