@@ -5,7 +5,7 @@ module Test.Golden.TxView (txViewTests) where
5
5
import Cardano.Prelude
6
6
7
7
import Hedgehog (Group (.. ), Property , checkSequential )
8
- import Hedgehog.Extras.Test.Base (moduleWorkspace , propertyOnce )
8
+ import Hedgehog.Extras (moduleWorkspace , note_ , propertyOnce )
9
9
10
10
import Test.OptParse (execCardanoCLI , noteTempFile )
11
11
import Test.Utilities (diffVsGoldenFile )
@@ -16,11 +16,11 @@ txViewTests :: IO Bool
16
16
txViewTests =
17
17
checkSequential $
18
18
Group " `transaction view` Goldens"
19
- [ (" golden_view_byron" , golden_view_byron)
19
+ [ (" golden_view_byron" , golden_view_byron)
20
20
, (" golden_view_shelley" , golden_view_shelley)
21
21
, (" golden_view_allegra" , golden_view_allegra)
22
- , (" golden_view_mary" , golden_view_mary)
23
- -- , ("golden_view_alonzo", golden_view_alonzo)
22
+ , (" golden_view_mary" , golden_view_mary)
23
+ , (" golden_view_alonzo" , golden_view_alonzo)
24
24
]
25
25
26
26
golden_view_byron :: Property
@@ -53,7 +53,46 @@ golden_view_shelley :: Property
53
53
golden_view_shelley =
54
54
propertyOnce $
55
55
moduleWorkspace " tmp" $ \ tempDir -> do
56
- transactionBodyFile <- noteTempFile tempDir " transaction-body-file"
56
+ updateProposalFile <- noteTempFile tempDir " update-proposal"
57
+ transactionBodyFile <- noteTempFile tempDir " transaction-body"
58
+
59
+ let extraEntropySeed = " c0ffee"
60
+ note_ $ " extra entropy seed: " ++ extraEntropySeed
61
+ note_
62
+ " extra entropy hash:\
63
+ \ 88f04f011dcded879039ae4b9b20219d9448e5c7b42c2d1f638fb8740e0ab8be"
64
+
65
+ note_
66
+ " genesis-verification-key-file hash:\
67
+ \ 81cb0bc5b6fbba391e6f7ec3d9271cbea25bcbf907181b7c4d5f8c2f"
68
+
69
+ -- Create update proposal
70
+ void $
71
+ execCardanoCLI
72
+ [ " governance" , " create-update-proposal"
73
+ , " --decentralization-parameter" , " 63/64"
74
+ , " --epoch" , " 64"
75
+ , " --extra-entropy" , extraEntropySeed
76
+ , " --genesis-verification-key-file"
77
+ , " test/data/golden/shelley/keys/genesis_keys/verification_key"
78
+ , " --key-reg-deposit-amt" , " 71"
79
+ , " --max-block-body-size" , " 72"
80
+ , " --max-block-header-size" , " 73"
81
+ , " --max-tx-size" , " 74"
82
+ , " --min-fee-constant" , " 75"
83
+ , " --min-fee-linear" , " 76"
84
+ , " --min-pool-cost" , " 77"
85
+ , " --min-utxo-value" , " 78"
86
+ , " --monetary-expansion" , " 79/80"
87
+ , " --number-of-pools" , " 80"
88
+ , " --out-file" , updateProposalFile
89
+ , " --pool-influence" , " 82/83"
90
+ , " --pool-reg-deposit" , " 83"
91
+ , " --pool-retirement-epoch-boundary" , " 84"
92
+ , " --protocol-major-version" , " 85"
93
+ , " --protocol-minor-version" , " 86"
94
+ , " --treasury-expansion" , " 87/88"
95
+ ]
57
96
58
97
-- Create transaction body
59
98
void $
@@ -70,6 +109,7 @@ golden_view_shelley =
70
109
, " --withdrawal"
71
110
, " stake_test1up00fz9lyqs5sjks82k22eqz7a9srym9vysjgp3h2ua2v2cm522kg\
72
111
\+42"
112
+ , " --update-proposal-file" , updateProposalFile
73
113
, " --out-file" , transactionBodyFile
74
114
]
75
115
@@ -173,3 +213,51 @@ golden_view_mary =
173
213
execCardanoCLI
174
214
[" transaction" , " view" , " --tx-body-file" , transactionBodyFile]
175
215
diffVsGoldenFile result " test/data/golden/mary/transaction-view.out"
216
+
217
+ golden_view_alonzo :: Property
218
+ golden_view_alonzo =
219
+ propertyOnce $
220
+ moduleWorkspace " tmp" $ \ tempDir -> do
221
+ updateProposalFile <- noteTempFile tempDir " update-proposal"
222
+ transactionBodyFile <- noteTempFile tempDir " transaction-body"
223
+
224
+ note_
225
+ " genesis-verification-key-file hash:\
226
+ \ 1bafa294233a5a7ffbf539ae798da0943aa83d2a19398c2d0e5af114"
227
+
228
+ -- Create update proposal
229
+ void $
230
+ execCardanoCLI
231
+ [ " governance" , " create-update-proposal"
232
+ , " --epoch" , " 190"
233
+ , " --genesis-verification-key-file"
234
+ , " test/data/golden/shelley/keys/genesis_keys/verification_key"
235
+ , " --utxo-cost-per-word" , " 194"
236
+ , " --price-execution-steps" , " 195/196"
237
+ , " --price-execution-memory" , " 196/197"
238
+ , " --max-tx-execution-units" , " (197, 198)"
239
+ , " --max-block-execution-units" , " (198, 199)"
240
+ , " --max-value-size" , " 199"
241
+ , " --collateral-percent" , " 200"
242
+ , " --max-collateral-inputs" , " 201"
243
+ , " --out-file" , updateProposalFile
244
+ ]
245
+
246
+ -- Create transaction body
247
+ void $
248
+ execCardanoCLI
249
+ [ " transaction" , " build-raw"
250
+ , " --alonzo-era"
251
+ , " --tx-in"
252
+ , " ed7c8f68c194cc763ee65ad22ef0973e26481be058c65005fd39fb93f9c43a20\
253
+ \#212"
254
+ , " --fee" , " 213"
255
+ , " --update-proposal-file" , updateProposalFile
256
+ , " --out-file" , transactionBodyFile
257
+ ]
258
+
259
+ -- View transaction body
260
+ result <-
261
+ execCardanoCLI
262
+ [" transaction" , " view" , " --tx-body-file" , transactionBodyFile]
263
+ diffVsGoldenFile result " test/data/golden/alonzo/transaction-view.out"
0 commit comments