~zinigor/cardano-node/trunk

« back to all changes in this revision

Viewing changes to cardano-cli/test/Test/Golden/Shelley/Transaction/CreateWitness.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.Transaction.CreateWitness
 
4
  ( golden_shelleyTransactionSigningKeyWitness
 
5
  ) where
 
6
 
 
7
import           Cardano.Prelude
 
8
import           Prelude (String)
 
9
 
 
10
import           Hedgehog (Property)
 
11
import           Test.OptParse
 
12
 
 
13
import qualified Hedgehog.Extras.Test.Base as H
 
14
import qualified Hedgehog.Extras.Test.File as H
 
15
 
 
16
{- HLINT ignore "Use camelCase" -}
 
17
 
 
18
txIn :: String
 
19
txIn = "2392d2b1200b5139fe555c81261697b29a8ccf561c5c783d46e78a479d977053#0"
 
20
 
 
21
txOut :: String
 
22
txOut = "addr1q94cxl99qvtwunsqqv6g9mgj3zrawtpt4edsgwxkjtwpy5dsezcht90tmwfur7t5hc9fk8hjd3r5vjwec2h8vmk3xh8s7er7t3+100"
 
23
 
 
24
golden_shelleyTransactionSigningKeyWitness :: Property
 
25
golden_shelleyTransactionSigningKeyWitness = propertyOnce $ H.moduleWorkspace "tmp" $ \tempDir -> do
 
26
  txBodyOutFile <- noteTempFile tempDir "tx-body-out"
 
27
 
 
28
  -- Create tx body file
 
29
  void $ execCardanoCLI
 
30
    [ "transaction","build-raw"
 
31
    , "--shelley-era"
 
32
    , "--tx-in", txIn
 
33
    , "--tx-out", txOut
 
34
    , "--invalid-hereafter", "60"
 
35
    , "--fee", "12"
 
36
    , "--tx-body-file", txBodyOutFile
 
37
    ]
 
38
 
 
39
  -- Create all multisig witness
 
40
  witnessOutFile <- noteTempFile tempDir "signingkey-witness"
 
41
  signingKeyFile <- noteInputFile "test/data/golden/shelley/keys/payment_keys/signing_key"
 
42
  void $ execCardanoCLI
 
43
    [ "transaction","witness"
 
44
    , "--tx-body-file", txBodyOutFile
 
45
    , "--signing-key-file", signingKeyFile
 
46
    , "--mainnet"
 
47
    , "--out-file", witnessOutFile
 
48
    ]
 
49
 
 
50
  H.assertFileOccurences 1 "TxWitnessShelley" witnessOutFile
 
51
  H.assertEndsWithSingleNewline txBodyOutFile