2
2
3
3
module Test.Golden.Shelley.Transaction.CalculateMinFee
4
4
( golden_shelleyTransactionCalculateMinFee
5
+ , golden_shelleyTransactionCalculateMinFee_outFile
5
6
) where
6
7
7
- import Hedgehog (Property )
8
- import Test.OptParse
9
-
8
+ import Hedgehog (Property , (===) )
10
9
import qualified Hedgehog.Extras.Test.Base as H
11
10
import qualified Hedgehog.Extras.Test.File as H
11
+ import Test.OptParse
12
+ import Test.Utilities (diffVsGoldenFile )
12
13
13
14
{- HLINT ignore "Use camelCase" -}
14
15
@@ -34,3 +35,27 @@ golden_shelleyTransactionCalculateMinFee = propertyOnce $ H.moduleWorkspace "tmp
34
35
H. assertFileOccurences 1 " 5083100" minFeeTxtFile
35
36
H. assertFileLines (== 1 ) minFeeTxtFile
36
37
H. assertEndsWithSingleNewline minFeeTxtFile
38
+
39
+ golden_shelleyTransactionCalculateMinFee_outFile :: Property
40
+ golden_shelleyTransactionCalculateMinFee_outFile = propertyOnce $ H. moduleWorkspace " tmp" $ \ tempDir -> do
41
+ protocolParamsJsonFile <- noteInputFile " test/data/golden/shelley/transaction-calculate-min-fee/protocol-params.json"
42
+ txBodyFile <- noteInputFile " test/data/golden/shelley/tx/txbody"
43
+ outFile <- noteTempFile tempDir " out-file"
44
+
45
+ minFeeTxt <- execCardanoCLI
46
+ [ " transaction" ," calculate-min-fee"
47
+ , " --out-file" , outFile
48
+ , " --tx-in-count" , " 32"
49
+ , " --tx-out-count" , " 27"
50
+ , " --byron-witness-count" , " 5"
51
+ , " --witness-count" , " 10"
52
+ , " --testnet-magic" , " 4036000900"
53
+ , " --protocol-params-file" , protocolParamsJsonFile
54
+ , " --tx-body-file" , txBodyFile
55
+ ]
56
+
57
+ minFeeTxt === " "
58
+
59
+ resultJson <- H. readFile outFile
60
+
61
+ diffVsGoldenFile resultJson " test/data/golden/shelley/tx/calculate-min-fee/out-file.json"
0 commit comments