-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4629 from IntersectMBO/aniketd/add-txinfo-golden-…
…test-for-conway Add TxInfo golden test for Conway
- Loading branch information
Showing
7 changed files
with
45 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
eras/conway/impl/test/Test/Cardano/Ledger/Conway/GoldenTranslation.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{-# LANGUAGE AllowAmbiguousTypes #-} | ||
{-# LANGUAGE BlockArguments #-} | ||
{-# LANGUAGE ConstraintKinds #-} | ||
{-# LANGUAGE DataKinds #-} | ||
{-# LANGUAGE FlexibleContexts #-} | ||
{-# LANGUAGE FlexibleInstances #-} | ||
{-# LANGUAGE OverloadedStrings #-} | ||
{-# LANGUAGE ScopedTypeVariables #-} | ||
{-# LANGUAGE TypeApplications #-} | ||
{-# LANGUAGE TypeFamilies #-} | ||
|
||
-- | Deserializes `TranslationInstance`s from golden/translations.cbor file. | ||
-- | ||
-- To regenerate the golden file (for example, if the logic in the translation changes), | ||
-- run the following command from the root of the repository: | ||
-- cabal run cardano-ledger-<era>:gen-golden" | ||
module Test.Cardano.Ledger.Conway.GoldenTranslation ( | ||
spec, | ||
) | ||
where | ||
|
||
import Cardano.Ledger.Conway (Conway) | ||
import Paths_cardano_ledger_conway (getDataFileName) | ||
import Test.Cardano.Ledger.Alonzo.Translation.Golden (assertTranslationResultsMatchGolden) | ||
import Test.Cardano.Ledger.Common | ||
import Test.Cardano.Ledger.Conway.Translation.TranslatableGen () | ||
import Test.HUnit (Assertion) | ||
|
||
spec :: Spec | ||
spec = | ||
describe "Golden translation tests" $ | ||
it "golden/translation.cbor" $ | ||
check "golden/translations.cbor" | ||
|
||
check :: String -> Assertion | ||
check file = assertTranslationResultsMatchGolden @Conway (getDataFileName file) |