~zinigor/cardano-node/trunk

« back to all changes in this revision

Viewing changes to cardano-cli/test/Test/Golden/Shelley/Genesis/InitialTxIn.hs

  • Committer: Igor Zinovyev
  • Date: 2021-08-13 19:12:27 UTC
  • Revision ID: zinigor@gmail.com-20210813191227-stlnsj3mc5ypwn0c
Tags: upstream-1.27.0
ImportĀ upstreamĀ versionĀ 1.27.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
{-# LANGUAGE OverloadedStrings #-}
 
2
 
 
3
module Test.Golden.Shelley.Genesis.InitialTxIn
 
4
  ( golden_shelleyGenesisInitialTxIn
 
5
  ) where
 
6
 
 
7
import           Cardano.Prelude
 
8
import           Hedgehog (Property)
 
9
import           Test.OptParse
 
10
 
 
11
import qualified Hedgehog.Extras.Test.Base as H
 
12
import qualified Hedgehog.Extras.Test.File as H
 
13
 
 
14
{- HLINT ignore "Use camelCase" -}
 
15
 
 
16
golden_shelleyGenesisInitialTxIn :: Property
 
17
golden_shelleyGenesisInitialTxIn = propertyOnce . H.moduleWorkspace "tmp" $ \tempDir -> do
 
18
  verificationKeyFile <- noteInputFile "test/data/golden/shelley/keys/genesis_verification_keys/genesis-utxo.vkey"
 
19
  goldenUtxoHashFile <- noteInputFile "test/data/golden/shelley/keys/genesis_utxo_hashes/utxo_hash"
 
20
  utxoHashFile <- noteTempFile tempDir "utxo_hash"
 
21
 
 
22
  utxoHash <- execCardanoCLI
 
23
    [ "genesis","initial-txin"
 
24
    , "--testnet-magic", "16"
 
25
    , "--verification-key-file", verificationKeyFile
 
26
    ]
 
27
 
 
28
  H.writeFile utxoHashFile utxoHash
 
29
 
 
30
  goldenUtxoHash <- H.readFile goldenUtxoHashFile
 
31
 
 
32
  equivalence utxoHash goldenUtxoHash