Skip to content

Commit

Permalink
Merge #3862
Browse files Browse the repository at this point in the history
3862: Update index state to 2022-07-01T00:00:00Z r=Jimbo4350 a=newhoggy



Co-authored-by: John Ky <john.ky@iohk.io>
Co-authored-by: Hamish Mackenzie <Hamish.K.Mackenzie@gmail.com>
  • Loading branch information
3 people authored Jul 5, 2022
2 parents 42809ad + 15cd88d commit 96a58be
Show file tree
Hide file tree
Showing 24 changed files with 3,330 additions and 889 deletions.
5 changes: 4 additions & 1 deletion bench/locli/src/Cardano/Analysis/Chain.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{-# LANGUAGE GeneralizedNewtypeDeriving#-}
{-# OPTIONS_GHC -Wno-deprecations -Wno-orphans #-}

{-# OPTIONS_GHC -Wno-orphans #-}

{- HLINT ignore "Use head" -}

module Cardano.Analysis.Chain (module Cardano.Analysis.Chain) where

import Cardano.Prelude hiding (head)
Expand Down
3 changes: 2 additions & 1 deletion bench/locli/src/Cardano/Analysis/ChainFilter.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE StrictData #-}
{-# OPTIONS_GHC -Wno-deprecations -Wno-orphans #-}

{- HLINT ignore "Use head" -}

module Cardano.Analysis.ChainFilter (module Cardano.Analysis.ChainFilter) where

import Cardano.Prelude hiding (head)
Expand Down
8 changes: 5 additions & 3 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-- run `nix flake lock --update-input hackageNix` after updating index-state.
index-state: 2022-02-18T00:00:00Z
index-state: 2022-07-01T00:00:00Z

packages:
cardano-api
Expand Down Expand Up @@ -227,8 +227,8 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-prelude
tag: bb4ed71ba8e587f672d06edf9d2e376f4b055555
--sha256: 00h10l5mmiza9819p9v5q5749nb9pzgi20vpzpy1d34zmh6gf1cj
tag: c7fc9fba236972c27a55e0f3d34c2758cf616bfc
--sha256: 0sg1hhnifqxfc5n5f9ikbxyrjlg77hynbhsql0h4smqniw29dbwk
subdir:
cardano-prelude
cardano-prelude-test
Expand Down Expand Up @@ -339,6 +339,8 @@ constraints:
-- that dependency
, network >= 3.1.1.0
, HSOpenSSL >= 0.11.7.2
, algebraic-graphs < 0.7
, protolude < 0.3.1

package snap-server
flags: +openssl
Expand Down
1 change: 0 additions & 1 deletion cardano-api/cardano-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ test-suite cardano-api-test
, tasty
, tasty-hedgehog
, tasty-quickcheck
, tasty-th
, time

other-modules: Test.Cardano.Api.Crypto
Expand Down
29 changes: 17 additions & 12 deletions cardano-api/test/Test/Cardano/Api/Json.hs
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE TemplateHaskell #-}

module Test.Cardano.Api.Json
( tests
) where

import Cardano.Api.Orphans ()
import Cardano.Api.Shelley
import Cardano.Prelude

import Data.Aeson (FromJSON (parseJSON), ToJSON (toJSON), eitherDecode, encode)
import Data.Aeson.Types (Parser, parseEither)
import Hedgehog (Property, forAll, tripping)
import qualified Hedgehog as H
import Test.Tasty (TestTree)
import Test.Tasty.Hedgehog (testProperty)
import Test.Tasty.TH (testGroupGenerator)

import Cardano.Api
import Cardano.Api.Orphans ()
import Cardano.Api.Shelley
import Gen.Cardano.Api (genAlonzoGenesis)
import Gen.Cardano.Api.Typed
import Hedgehog (Property, forAll, tripping)
import Test.Tasty (TestTree, testGroup)
import Test.Tasty.Hedgehog (testPropertyNamed)

import qualified Hedgehog as H

{- HLINT ignore "Use camelCase" -}

Expand Down Expand Up @@ -87,4 +83,13 @@ prop_json_roundtrip_scriptdata_detailed_json = H.property $ do
tripping sData scriptDataToJsonDetailedSchema scriptDataFromJsonDetailedSchema

tests :: TestTree
tests = $testGroupGenerator
tests = testGroup "Test.Cardano.Api.Json"
[ testPropertyNamed "json roundtrip alonzo genesis" "json roundtrip alonzo genesis" prop_json_roundtrip_alonzo_genesis
, testPropertyNamed "json roundtrip utxo" "json roundtrip utxo" prop_json_roundtrip_utxo
, testPropertyNamed "json roundtrip reference scripts" "json roundtrip reference scripts" prop_json_roundtrip_reference_scripts
, testPropertyNamed "json roundtrip txoutvalue" "json roundtrip txoutvalue" prop_json_roundtrip_txoutvalue
, testPropertyNamed "json roundtrip txout tx context" "json roundtrip txout tx context" prop_json_roundtrip_txout_tx_context
, testPropertyNamed "json roundtrip txout utxo context" "json roundtrip txout utxo context" prop_json_roundtrip_txout_utxo_context
, testPropertyNamed "json roundtrip eraInMode" "json roundtrip eraInMode" prop_json_roundtrip_eraInMode
, testPropertyNamed "json roundtrip scriptdata detailed json" "json roundtrip scriptdata detailed json" prop_json_roundtrip_scriptdata_detailed_json
]
17 changes: 8 additions & 9 deletions cardano-api/test/Test/Cardano/Api/KeysByron.hs
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TemplateHaskell #-}

module Test.Cardano.Api.KeysByron
( tests
) where

import Cardano.Prelude

import Cardano.Api (AsType(AsByronKey, AsSigningKey), Key(deterministicSigningKey))
import Cardano.Prelude ((<$>))
import Gen.Hedgehog.Roundtrip.CBOR (roundtrip_CBOR)
import Hedgehog (Property)
import Test.Cardano.Api.Typed.Orphans ()
import Test.Tasty (TestTree)
import Test.Tasty.Hedgehog (testProperty)
import Test.Tasty.TH (testGroupGenerator)
import Test.Tasty (TestTree, testGroup)
import Test.Tasty.Hedgehog (testPropertyNamed)

import Cardano.Api
import qualified Gen.Cardano.Crypto.Seed as Gen
import Gen.Hedgehog.Roundtrip.CBOR (roundtrip_CBOR)

{- HLINT ignore "Use camelCase" -}

Expand All @@ -24,4 +21,6 @@ prop_roundtrip_byron_key_CBOR =
roundtrip_CBOR (AsSigningKey AsByronKey) (deterministicSigningKey AsByronKey <$> Gen.genSeedForKey AsByronKey)

tests :: TestTree
tests = $testGroupGenerator
tests = testGroup "Test.Cardano.Api.KeysByron"
[ testPropertyNamed "roundtrip byron key CBOR" "roundtrip byron key CBOR" prop_roundtrip_byron_key_CBOR
]
25 changes: 12 additions & 13 deletions cardano-api/test/Test/Cardano/Api/Ledger.hs
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeApplications #-}

module Test.Cardano.Api.Ledger
( tests
) where

import Cardano.Prelude

import Hedgehog (Property)
import qualified Hedgehog as H
import qualified Hedgehog.Extras.Aeson as H
import Test.Tasty (TestTree)
import Test.Tasty.Hedgehog (testProperty)
import Test.Tasty.TH (testGroupGenerator)

import Cardano.Ledger.Address (deserialiseAddr, serialiseAddr)
import Cardano.Prelude (($))
import Hedgehog (Property)
import Ouroboros.Consensus.Shelley.Eras (StandardCrypto)
import Test.Cardano.Api.Genesis
import Test.Cardano.Api.Genesis (exampleShelleyGenesis)
import Test.Cardano.Ledger.Shelley.Serialisation.Generators.Genesis (genAddress)
import Test.Tasty (TestTree, testGroup)
import Test.Tasty.Hedgehog (testPropertyNamed)

import qualified Hedgehog as H
import qualified Hedgehog.Extras.Aeson as H

prop_golden_ShelleyGenesis :: Property
prop_golden_ShelleyGenesis = H.goldenTestJsonValuePretty exampleShelleyGenesis "test/Golden/ShelleyGenesis"
Expand All @@ -35,4 +31,7 @@ prop_roundtrip_Address_CBOR = H.property $ do
-- -----------------------------------------------------------------------------

tests :: TestTree
tests = $testGroupGenerator
tests = testGroup "Test.Cardano.Api.Ledger"
[ testPropertyNamed "golden ShelleyGenesis" "golden ShelleyGenesis" prop_golden_ShelleyGenesis
, testPropertyNamed "roundtrip Address CBOR" "roundtrip Address CBOR" prop_roundtrip_Address_CBOR
]
28 changes: 19 additions & 9 deletions cardano-api/test/Test/Cardano/Api/Metadata.hs
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}

module Test.Cardano.Api.Metadata
( tests
, genTxMetadata
, genTxMetadataValue
) where

import Cardano.Api
import Cardano.Prelude
import Gen.Cardano.Api.Metadata
import Hedgehog (Property, property, (===))
import Test.Tasty (TestTree, testGroup)
import Test.Tasty.Hedgehog (testPropertyNamed)

import qualified Data.Aeson as Aeson
import qualified Data.Map.Strict as Map
import Hedgehog (Property, property, (===))
import qualified Hedgehog
import Test.Tasty (TestTree)
import Test.Tasty.Hedgehog (testProperty)
import Test.Tasty.TH (testGroupGenerator)

import Cardano.Api
import Gen.Cardano.Api.Metadata

-- ----------------------------------------------------------------------------
-- Golden / unit tests
Expand Down Expand Up @@ -123,4 +121,16 @@ prop_metadata_roundtrip_via_schema_json = Hedgehog.property $ do
--

tests :: TestTree
tests = $testGroupGenerator
tests = testGroup "Test.Cardano.Api.Metadata"
[ testPropertyNamed "golden 1" "golden 1" prop_golden_1
, testPropertyNamed "golden 2" "golden 2" prop_golden_2
, testPropertyNamed "golden 3" "golden 3" prop_golden_3
, testPropertyNamed "golden 4" "golden 4" prop_golden_4
, testPropertyNamed "golden 5" "golden 5" prop_golden_5
, testPropertyNamed "golden 6" "golden 6" prop_golden_6
, testPropertyNamed "golden 7" "golden 7" prop_golden_7
, testPropertyNamed "golden 8" "golden 8" prop_golden_8
, testPropertyNamed "noschema json roundtrip via metadata" "noschema json roundtrip via metadata" prop_noschema_json_roundtrip_via_metadata
, testPropertyNamed "schema json roundtrip via metadata" "schema json roundtrip via metadata" prop_schema_json_roundtrip_via_metadata
, testPropertyNamed "metadata roundtrip via schema json" "metadata roundtrip via schema json" prop_metadata_roundtrip_via_schema_json
]
22 changes: 11 additions & 11 deletions cardano-api/test/Test/Cardano/Api/Typed/Address.hs
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TemplateHaskell #-}

module Test.Cardano.Api.Typed.Address
( tests
) where

import Cardano.Prelude

import Hedgehog (Property)
import qualified Hedgehog as H
import Test.Tasty (TestTree)
import Test.Tasty.Hedgehog (testProperty)
import Test.Tasty.TH (testGroupGenerator)

import Cardano.Api
import Gen.Cardano.Api.Typed
import Cardano.Prelude (($), Eq, Show)
import Gen.Cardano.Api.Typed (genAddressByron, genAddressShelley)
import Hedgehog (Property)
import Test.Cardano.Api.Typed.Orphans ()
import Test.Tasty (TestTree, testGroup)
import Test.Tasty.Hedgehog (testPropertyNamed)

import qualified Hedgehog as H

{- HLINT ignore "Use camelCase" -}

Expand Down Expand Up @@ -46,4 +43,7 @@ roundtrip_serialise_address asType g =
-- -----------------------------------------------------------------------------

tests :: TestTree
tests = $testGroupGenerator
tests = testGroup "Test.Cardano.Api.Typed.Address"
[ testPropertyNamed "roundtrip shelley address" "roundtrip shelley address" prop_roundtrip_shelley_address
, testPropertyNamed "roundtrip byron address" "roundtrip byron address" prop_roundtrip_byron_address
]
18 changes: 9 additions & 9 deletions cardano-api/test/Test/Cardano/Api/Typed/Bech32.hs
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
{-# LANGUAGE TemplateHaskell #-}
module Test.Cardano.Api.Typed.Bech32
( tests
) where

import Hedgehog (Property)
import Test.Tasty (TestTree)
import Test.Tasty.Hedgehog (testProperty)
import Test.Tasty.TH (testGroupGenerator)

import Cardano.Api
import Gen.Cardano.Api.Typed
import Cardano.Api (AsType(AsStakeAddress, AsShelleyAddress))
import Gen.Cardano.Api.Typed( genAddressShelley, genStakeAddress)
import Gen.Hedgehog.Roundtrip.Bech32 (roundtrip_Bech32)
import Hedgehog (Property)
import Test.Tasty (TestTree, testGroup)
import Test.Tasty.Hedgehog (testPropertyNamed)

prop_roundtrip_Address_Shelley :: Property
prop_roundtrip_Address_Shelley = roundtrip_Bech32 AsShelleyAddress genAddressShelley
Expand All @@ -19,4 +16,7 @@ prop_roundtrip_StakeAddress :: Property
prop_roundtrip_StakeAddress = roundtrip_Bech32 AsStakeAddress genStakeAddress

tests :: TestTree
tests = $testGroupGenerator
tests = testGroup "Test.Cardano.Api.Typed.Bech32"
[ testPropertyNamed "roundtrip Address Shelley" "roundtrip Address Shelley" prop_roundtrip_Address_Shelley
, testPropertyNamed "roundtrip StakeAddress" "roundtrip StakeAddress" prop_roundtrip_StakeAddress
]
Loading

0 comments on commit 96a58be

Please sign in to comment.