Skip to content

Commit

Permalink
add integration test for execution unit prices
Browse files Browse the repository at this point in the history
  • Loading branch information
paweljakubas committed Sep 14, 2021
1 parent 5f21d53 commit ec6c3f1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
@@ -1,5 +1,6 @@
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedLabels #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
Expand Down Expand Up @@ -68,6 +69,13 @@ spec = describe "SHELLEY_NETWORK" $ do
let knownEras = [minBound .. _mainEra ctx]
let unknownEras = [minBound .. maxBound] \\ knownEras

let checkExecutionUnitPricesPresence
:: ApiEra
-> ((HTTP.Status, Either RequestException ApiNetworkParameters) -> IO ())
checkExecutionUnitPricesPresence = \case
ApiAlonzo -> expectField #executionUnitPrices (`shouldNotBe` Nothing)
_ -> expectField #executionUnitPrices (`shouldBe` Nothing)

verify r $
[ expectField #decentralizationLevel (`shouldBe` d)
, expectField #desiredPoolNumber (`shouldBe` nOpt)
Expand All @@ -79,6 +87,7 @@ spec = describe "SHELLEY_NETWORK" $ do
, expectField #maximumCollateralInputCount
(`shouldBe` maximumCollateralInputCountByEra (_mainEra ctx))
, expectField #maximumTokenBundleSize (`shouldBe` Quantity 4000)
, checkExecutionUnitPricesPresence (_mainEra ctx)
]
++ map (expectEraField (`shouldNotBe` Nothing)) knownEras
++ map (expectEraField (`shouldBe` Nothing)) unknownEras
2 changes: 1 addition & 1 deletion lib/core/src/Cardano/Wallet/Transaction.hs
Expand Up @@ -127,7 +127,7 @@ data TransactionLayer k = TransactionLayer
:: ProtocolParameters
-- Current protocol parameters
-> SealedTx
-- The constructed transaction that could contain
-- The constructed transaction that could contain plutus scripts
-> Coin
-- ^ Compute an execution costs of scripts in a given transaction.

Expand Down

0 comments on commit ec6c3f1

Please sign in to comment.