|
| 1 | +{-# LANGUAGE OverloadedStrings #-} |
| 2 | + |
| 3 | +module Test.Golden.Debug.TransactionView where |
| 4 | + |
| 5 | +import System.FilePath ((</>)) |
| 6 | + |
| 7 | +import Test.Cardano.CLI.Util (execCardanoCLI, watchdogProp) |
| 8 | + |
| 9 | +import Hedgehog (Property) |
| 10 | +import Hedgehog.Extras.Test (propertyOnce) |
| 11 | +import Hedgehog.Extras.Test qualified as H |
| 12 | + |
| 13 | +inputDir, goldenDir :: FilePath |
| 14 | +inputDir = "test/cardano-cli-golden/files/input" |
| 15 | +goldenDir = "test/cardano-cli-golden/files/golden" |
| 16 | + |
| 17 | +-- ---------------------------------------------------------------------------- |
| 18 | +-- Shelley era tests |
| 19 | +-- ---------------------------------------------------------------------------- |
| 20 | + |
| 21 | +-- | Execute me with: |
| 22 | +-- @cabal test cardano-cli-golden --test-options '-p "/golden debug transaction view shelley json/"'@ |
| 23 | +hprop_golden_debug_transaction_view_shelley_json :: Property |
| 24 | +hprop_golden_debug_transaction_view_shelley_json = |
| 25 | + watchdogProp . propertyOnce $ do |
| 26 | + result <- |
| 27 | + execCardanoCLI |
| 28 | + [ "debug" |
| 29 | + , "transaction" |
| 30 | + , "view" |
| 31 | + , "--tx-file" |
| 32 | + , inputDir </> "shelley/tx/signed.tx" |
| 33 | + , "--output-json" |
| 34 | + ] |
| 35 | + H.diffVsGoldenFile result $ goldenDir </> "shelley/transaction-view.json" |
| 36 | + |
| 37 | +-- | Execute me with: |
| 38 | +-- @cabal test cardano-cli-golden --test-options '-p "/golden debug transaction view shelley yaml/"'@ |
| 39 | +hprop_golden_debug_transaction_view_shelley_yaml :: Property |
| 40 | +hprop_golden_debug_transaction_view_shelley_yaml = |
| 41 | + watchdogProp . propertyOnce $ do |
| 42 | + result <- |
| 43 | + execCardanoCLI |
| 44 | + [ "debug" |
| 45 | + , "transaction" |
| 46 | + , "view" |
| 47 | + , "--tx-file" |
| 48 | + , inputDir </> "shelley/tx/signed.tx" |
| 49 | + , "--output-yaml" |
| 50 | + ] |
| 51 | + H.diffVsGoldenFile result $ goldenDir </> "shelley/transaction-view.yaml" |
| 52 | + |
| 53 | +-- ---------------------------------------------------------------------------- |
| 54 | +-- Allegra era tests |
| 55 | +-- ---------------------------------------------------------------------------- |
| 56 | + |
| 57 | +-- | Execute me with: |
| 58 | +-- @cabal test cardano-cli-golden --test-options '-p "/golden debug transaction view allegra json/"'@ |
| 59 | +hprop_golden_debug_transaction_view_allegra_json :: Property |
| 60 | +hprop_golden_debug_transaction_view_allegra_json = |
| 61 | + watchdogProp . propertyOnce $ do |
| 62 | + result <- |
| 63 | + execCardanoCLI |
| 64 | + [ "debug" |
| 65 | + , "transaction" |
| 66 | + , "view" |
| 67 | + , "--tx-file" |
| 68 | + , inputDir </> "allegra/tx/signed.tx" |
| 69 | + , "--output-json" |
| 70 | + ] |
| 71 | + H.diffVsGoldenFile result $ goldenDir </> "allegra/transaction-view.json" |
| 72 | + |
| 73 | +-- | Execute me with: |
| 74 | +-- @cabal test cardano-cli-golden --test-options '-p "/golden debug transaction view allegra yaml/"'@ |
| 75 | +hprop_golden_debug_transaction_view_allegra_yaml :: Property |
| 76 | +hprop_golden_debug_transaction_view_allegra_yaml = |
| 77 | + watchdogProp . propertyOnce $ do |
| 78 | + result <- |
| 79 | + execCardanoCLI |
| 80 | + [ "debug" |
| 81 | + , "transaction" |
| 82 | + , "view" |
| 83 | + , "--tx-file" |
| 84 | + , inputDir </> "allegra/tx/signed.tx" |
| 85 | + , "--output-yaml" |
| 86 | + ] |
| 87 | + H.diffVsGoldenFile result $ goldenDir </> "allegra/transaction-view.yaml" |
| 88 | + |
| 89 | +-- ---------------------------------------------------------------------------- |
| 90 | +-- Mary era tests |
| 91 | +-- ---------------------------------------------------------------------------- |
| 92 | + |
| 93 | +-- | Execute me with: |
| 94 | +-- @cabal test cardano-cli-golden --test-options '-p "/golden debug transaction view mary json/"'@ |
| 95 | +hprop_golden_debug_transaction_view_mary_json :: Property |
| 96 | +hprop_golden_debug_transaction_view_mary_json = |
| 97 | + watchdogProp . propertyOnce $ do |
| 98 | + result <- |
| 99 | + execCardanoCLI |
| 100 | + [ "debug" |
| 101 | + , "transaction" |
| 102 | + , "view" |
| 103 | + , "--tx-file" |
| 104 | + , inputDir </> "mary/tx/signed.tx" |
| 105 | + , "--output-json" |
| 106 | + ] |
| 107 | + H.diffVsGoldenFile result $ goldenDir </> "mary/transaction-view.json" |
| 108 | + |
| 109 | +-- | Execute me with: |
| 110 | +-- @cabal test cardano-cli-golden --test-options '-p "/golden debug transaction view mary yaml/"'@ |
| 111 | +hprop_golden_debug_transaction_view_mary_yaml :: Property |
| 112 | +hprop_golden_debug_transaction_view_mary_yaml = |
| 113 | + watchdogProp . propertyOnce $ do |
| 114 | + result <- |
| 115 | + execCardanoCLI |
| 116 | + [ "debug" |
| 117 | + , "transaction" |
| 118 | + , "view" |
| 119 | + , "--tx-file" |
| 120 | + , inputDir </> "mary/tx/signed.tx" |
| 121 | + , "--output-yaml" |
| 122 | + ] |
| 123 | + H.diffVsGoldenFile result $ goldenDir </> "mary/transaction-view.yaml" |
| 124 | + |
| 125 | +-- ---------------------------------------------------------------------------- |
| 126 | +-- Alonzo era tests |
| 127 | +-- ---------------------------------------------------------------------------- |
| 128 | + |
| 129 | +-- | Execute me with: |
| 130 | +-- @cabal test cardano-cli-golden --test-options '-p "/golden debug transaction view alonzo json/"'@ |
| 131 | +hprop_golden_debug_transaction_view_alonzo_json :: Property |
| 132 | +hprop_golden_debug_transaction_view_alonzo_json = |
| 133 | + watchdogProp . propertyOnce $ do |
| 134 | + result <- |
| 135 | + execCardanoCLI |
| 136 | + [ "debug" |
| 137 | + , "transaction" |
| 138 | + , "view" |
| 139 | + , "--tx-file" |
| 140 | + , inputDir </> "alonzo/tx/signed.tx" |
| 141 | + , "--output-json" |
| 142 | + ] |
| 143 | + H.diffVsGoldenFile result $ goldenDir </> "alonzo/transaction-view.json" |
| 144 | + |
| 145 | +-- ---------------------------------------------------------------------------- |
| 146 | +-- Babbage era tests |
| 147 | +-- ---------------------------------------------------------------------------- |
| 148 | + |
| 149 | +-- | Execute me with: |
| 150 | +-- @cabal test cardano-cli-golden --test-options '-p "/golden debug transaction view babbage json/"'@ |
| 151 | +hprop_golden_debug_transaction_view_babbage_json :: Property |
| 152 | +hprop_golden_debug_transaction_view_babbage_json = |
| 153 | + watchdogProp . propertyOnce $ do |
| 154 | + result <- |
| 155 | + execCardanoCLI |
| 156 | + [ "debug" |
| 157 | + , "transaction" |
| 158 | + , "view" |
| 159 | + , "--tx-file" |
| 160 | + , inputDir </> "babbage/tx/signed.tx" |
| 161 | + , "--output-json" |
| 162 | + ] |
| 163 | + H.diffVsGoldenFile result $ goldenDir </> "babbage/transaction-view.json" |
| 164 | + |
| 165 | +-- | Execute me with: |
| 166 | +-- @cabal test cardano-cli-golden --test-options '-p "/golden debug transaction view babbage yaml/"'@ |
| 167 | +hprop_golden_debug_transaction_view_babbage_yaml :: Property |
| 168 | +hprop_golden_debug_transaction_view_babbage_yaml = |
| 169 | + watchdogProp . propertyOnce $ do |
| 170 | + result <- |
| 171 | + execCardanoCLI |
| 172 | + [ "debug" |
| 173 | + , "transaction" |
| 174 | + , "view" |
| 175 | + , "--tx-file" |
| 176 | + , inputDir </> "babbage/tx/signed.tx" |
| 177 | + , "--output-yaml" |
| 178 | + ] |
| 179 | + H.diffVsGoldenFile result $ goldenDir </> "babbage/transaction-view.yaml" |
| 180 | + |
| 181 | +-- ---------------------------------------------------------------------------- |
| 182 | +-- Conway era tests |
| 183 | +-- ---------------------------------------------------------------------------- |
| 184 | + |
| 185 | +-- | Execute me with: |
| 186 | +-- @cabal test cardano-cli-golden --test-options '-p "/golden debug transaction view conway json/"'@ |
| 187 | +hprop_golden_debug_transaction_view_conway_json :: Property |
| 188 | +hprop_golden_debug_transaction_view_conway_json = |
| 189 | + watchdogProp . propertyOnce $ do |
| 190 | + result <- |
| 191 | + execCardanoCLI |
| 192 | + [ "debug" |
| 193 | + , "transaction" |
| 194 | + , "view" |
| 195 | + , "--tx-file" |
| 196 | + , inputDir </> "conway/tx/signed.tx" |
| 197 | + , "--output-json" |
| 198 | + ] |
| 199 | + H.diffVsGoldenFile result $ goldenDir </> "conway/transaction-view.json" |
| 200 | + |
| 201 | +-- | Execute me with: |
| 202 | +-- @cabal test cardano-cli-golden --test-options '-p "/golden debug transaction view conway yaml/"'@ |
| 203 | +hprop_golden_debug_transaction_view_conway_yaml :: Property |
| 204 | +hprop_golden_debug_transaction_view_conway_yaml = |
| 205 | + watchdogProp . propertyOnce $ do |
| 206 | + result <- |
| 207 | + execCardanoCLI |
| 208 | + [ "debug" |
| 209 | + , "transaction" |
| 210 | + , "view" |
| 211 | + , "--tx-file" |
| 212 | + , inputDir </> "conway/tx/signed.tx" |
| 213 | + , "--output-yaml" |
| 214 | + ] |
| 215 | + H.diffVsGoldenFile result $ goldenDir </> "conway/transaction-view.yaml" |
0 commit comments