Skip to content

Commit 640fb66

Browse files
authored
Merge pull request #5166 from IntersectMBO/td/reorganize-examples
Reorganize Consensus `Examples`
2 parents 1f0c6a4 + 64dc185 commit 640fb66

File tree

84 files changed

+1347
-2061
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+1347
-2061
lines changed

.github/workflows/haskell.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,12 +201,10 @@ jobs:
201201
- cardano-ledger-alonzo-test
202202
- cardano-ledger-api
203203
- cardano-ledger-babbage
204-
- cardano-ledger-babbage-test
205204
- cardano-ledger-binary
206205
- cardano-ledger-byron
207206
- cardano-ledger-conformance
208207
- cardano-ledger-conway
209-
- cardano-ledger-conway-test
210208
- cardano-ledger-core
211209
- cardano-ledger-dijkstra
212210
- cardano-ledger-mary

CHANGELOG.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,6 @@ Changes recorded below are for all of the package versions in the list:
284284
* `cardano-ledger-conway-1.0.0.0`
285285
* `cardano-ledger-shelley-ma-1.0.0.0`
286286
* `cardano-ledger-alonzo-test-1.0.0.0`
287-
* `cardano-ledger-babbage-test-1.0.0.0`
288-
* `cardano-ledger-conway-test-1.0.0.0`
289287
* `cardano-ledger-shelley-ma-test-1.0.0.0`
290288
* `cardano-ledger-shelley-test-1.0.0.0`
291289

RELEASING.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -333,13 +333,11 @@ but the changelog _only_ needs to indicate if breaking changes have been made:
333333
* `cardano-ledger-shelley-test`
334334
* `cardano-ledger-shelley-ma-test`
335335
* `cardano-ledger-alonzo-test`
336-
* `cardano-ledger-babbage-test`
337-
* `cardano-ledger-conway-test`
338336

339337
A changelog which indicates that no changes have been made will have the form:
340338

341339
```
342-
# Version history for `cardano-ledger-conway-test`
340+
# Version history for `cardano-ledger-conway`
343341
344342
## 1.2.0.1
345343
@@ -349,7 +347,7 @@ A changelog which indicates that no changes have been made will have the form:
349347
A changelog which indicates that changes have been made will have the form:
350348

351349
```
352-
# Version history for `cardano-ledger-conway-test`
350+
# Version history for `cardano-ledger-conway`
353351
354352
## 1.3.0.0
355353

REVISIONING.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,11 @@ Next, you will add the actual revisions and test if you can build your packages
6868
'.#"ghc96/cardano-ledger-alonzo/1.6.0.0"' \
6969
'.#"ghc96/cardano-ledger-alonzo-test/1.2.0.0"' \
7070
'.#"ghc96/cardano-ledger-babbage/1.6.0.0"' \
71-
'.#"ghc96/cardano-ledger-babbage-test/1.2.0.0"' \
7271
'.#"ghc96/byron-spec-chain/1.0.0.2"' \
7372
'.#"ghc96/byron-spec-ledger/1.0.0.2"' \
7473
'.#"ghc96/cardano-ledger-byron/1.0.0.4"' \
7574
'.#"ghc96/cardano-crypto-wrapper/1.5.1.1"' \
7675
'.#"ghc96/cardano-ledger-conway/1.12.0.0"' \
77-
'.#"ghc96/cardano-ledger-conway-test/1.2.1.3"' \
7876
'.#"ghc96/cardano-ledger-mary/1.5.0.0"' \
7977
'.#"ghc96/cardano-ledger-shelley/1.9.0.0"' \
8078
'.#"ghc96/cardano-ledger-shelley-test/1.3.0.1"' \
@@ -114,13 +112,11 @@ Next, you will add the actual revisions and test if you can build your packages
114112
'.#"ghc96/cardano-ledger-alonzo/1.6.0.0"' \
115113
'.#"ghc96/cardano-ledger-alonzo-test/1.2.0.0"' \
116114
'.#"ghc96/cardano-ledger-babbage/1.6.0.0"' \
117-
'.#"ghc96/cardano-ledger-babbage-test/1.2.0.0"' \
118115
'.#"ghc96/byron-spec-chain/1.0.0.2"' \
119116
'.#"ghc96/byron-spec-ledger/1.0.0.2"' \
120117
'.#"ghc96/cardano-ledger-byron/1.0.0.4"' \
121118
'.#"ghc96/cardano-crypto-wrapper/1.5.1.1"' \
122119
'.#"ghc96/cardano-ledger-conway/1.12.0.0"' \
123-
'.#"ghc96/cardano-ledger-conway-test/1.2.1.3"' \
124120
'.#"ghc96/cardano-ledger-mary/1.5.0.0"' \
125121
'.#"ghc96/cardano-ledger-shelley/1.9.0.0"' \
126122
'.#"ghc96/cardano-ledger-shelley-test/1.3.0.1"' \
@@ -161,13 +157,11 @@ extra-packages:
161157
cardano-ledger-alonzo-1.6.0.0,
162158
cardano-ledger-alonzo-test-1.2.0.0,
163159
cardano-ledger-babbage-1.6.0.0,
164-
cardano-ledger-babbage-test-1.2.0.0,
165160
byron-spec-chain-1.0.0.2,
166161
byron-spec-ledger-1.0.0.2,
167162
cardano-ledger-byron-1.0.0.4,
168163
cardano-crypto-wrapper-1.5.1.1,
169164
cardano-ledger-conway-1.12.0.0,
170-
cardano-ledger-conway-test-1.2.1.3,
171165
cardano-ledger-mary-1.5.0.0,
172166
cardano-ledger-shelley-1.9.0.0,
173167
cardano-ledger-shelley-test-1.3.0.1,
@@ -201,13 +195,11 @@ library
201195
cardano-ledger-alonzo \
202196
cardano-ledger-alonzo-test \
203197
cardano-ledger-babbage \
204-
cardano-ledger-babbage-test \
205198
byron-spec-chain \
206199
byron-spec-ledger \
207200
cardano-ledger-byron \
208201
cardano-crypto-wrapper \
209202
cardano-ledger-conway \
210-
cardano-ledger-conway-test \
211203
cardano-ledger-mary \
212204
cardano-ledger-shelley \
213205
cardano-ledger-shelley-test \
@@ -248,13 +240,11 @@ library
248240
cardano-ledger-alonzo \
249241
cardano-ledger-alonzo-test \
250242
cardano-ledger-babbage \
251-
cardano-ledger-babbage-test \
252243
byron-spec-chain \
253244
byron-spec-ledger \
254245
cardano-ledger-byron \
255246
cardano-crypto-wrapper \
256247
cardano-ledger-conway \
257-
cardano-ledger-conway-test \
258248
cardano-ledger-mary \
259249
cardano-ledger-shelley \
260250
cardano-ledger-shelley-test \

cabal.project

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@ packages:
4040
eras/alonzo/impl
4141
eras/alonzo/test-suite
4242
eras/babbage/impl
43-
eras/babbage/test-suite
4443
eras/conway/impl
45-
eras/conway/test-suite
4644
eras/dijkstra
4745
eras/mary/impl
4846
eras/shelley/impl

eras/allegra/impl/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
### `testlib`
1616

17+
* Added `Examples` module with: `ledgerExamples`, `exampleAllegraTxBody`, `exampleAllegraTxAuxData`
1718
* Added `Arbitrary` instance for `TransitionConfig AllegraEra`
1819
* Added `Era` module with `AllegraEraTest` class
1920

eras/allegra/impl/cardano-ledger-allegra.cabal

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ library testlib
9191
Test.Cardano.Ledger.Allegra.Binary.Cddl
9292
Test.Cardano.Ledger.Allegra.CDDL
9393
Test.Cardano.Ledger.Allegra.Era
94+
Test.Cardano.Ledger.Allegra.Examples
9495
Test.Cardano.Ledger.Allegra.Imp
9596
Test.Cardano.Ledger.Allegra.Imp.UtxowSpec
9697
Test.Cardano.Ledger.Allegra.ImpTest
@@ -117,6 +118,7 @@ library testlib
117118
cardano-ledger-binary,
118119
cardano-ledger-core:{cardano-ledger-core, testlib},
119120
cardano-ledger-shelley:{cardano-ledger-shelley, testlib},
121+
cardano-slotting,
120122
cardano-strict-containers,
121123
containers,
122124
cuddle >=0.4,

libs/cardano-ledger-api/testlib/Test/Cardano/Ledger/Api/Examples/Consensus/Allegra.hs renamed to eras/allegra/impl/testlib/Test/Cardano/Ledger/Allegra/Examples.hs

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55
{-# LANGUAGE TypeFamilies #-}
66
{-# LANGUAGE TypeOperators #-}
77

8-
module Test.Cardano.Ledger.Api.Examples.Consensus.Allegra (
9-
ledgerExamplesAllegra,
8+
module Test.Cardano.Ledger.Allegra.Examples (
9+
ledgerExamples,
1010
exampleAllegraTxBody,
11-
exampleTimelock,
1211
exampleAllegraTxAuxData,
1312
) where
1413

@@ -25,14 +24,26 @@ import Cardano.Slotting.Slot
2524
import Data.Proxy
2625
import qualified Data.Sequence.Strict as StrictSeq
2726
import Lens.Micro
28-
import Test.Cardano.Ledger.Api.Examples.Consensus.Shelley
2927
import Test.Cardano.Ledger.Core.KeyPair (mkAddr)
3028
import Test.Cardano.Ledger.Core.Utils (mkDummySafeHash)
29+
import Test.Cardano.Ledger.Shelley.Examples (
30+
LedgerExamples,
31+
exampleAuxDataMap,
32+
exampleCerts,
33+
exampleCoin,
34+
examplePayKey,
35+
exampleProposedPPUpdates,
36+
exampleStakeKey,
37+
exampleTxIns,
38+
exampleWithdrawals,
39+
mkKeyHash,
40+
mkLedgerExamples,
41+
mkWitnessesPreAlonzo,
42+
)
3143

32-
-- | ShelleyLedgerExamples for Allegra era
33-
ledgerExamplesAllegra :: ShelleyLedgerExamples AllegraEra
34-
ledgerExamplesAllegra =
35-
defaultShelleyLedgerExamples
44+
ledgerExamples :: LedgerExamples AllegraEra
45+
ledgerExamples =
46+
mkLedgerExamples
3647
(mkWitnessesPreAlonzo (Proxy @AllegraEra))
3748
exampleCoin
3849
(exampleAllegraTxBody exampleCoin)

eras/alonzo/impl/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848

4949
### `testlib`
5050

51+
* Added `Examples` module with: `ledgerExamples`, `mkLedgerExamples`, `exampleTx`, `exampleDatum`, `exampleAlonzoGenesis`
52+
* Added `Twiddle` instances for Alonzo core types
5153
* Add `Arbitrary` instance for `LangDepView`
5254
* Add `computeScriptIntegrityPure`, `computeScriptIntegrity` and `computeScriptIntegrityHash`
5355
* Added `TxInfoPV4` to `VersionedTxInfo`

eras/alonzo/impl/cardano-ledger-alonzo.cabal

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,11 @@ library testlib
112112
Test.Cardano.Ledger.Alonzo.Binary.Cddl
113113
Test.Cardano.Ledger.Alonzo.Binary.CostModelsSpec
114114
Test.Cardano.Ledger.Alonzo.Binary.RoundTrip
115+
Test.Cardano.Ledger.Alonzo.Binary.Twiddle
115116
Test.Cardano.Ledger.Alonzo.Binary.TxWitsSpec
116117
Test.Cardano.Ledger.Alonzo.CDDL
117118
Test.Cardano.Ledger.Alonzo.Era
119+
Test.Cardano.Ledger.Alonzo.Examples
118120
Test.Cardano.Ledger.Alonzo.Imp
119121
Test.Cardano.Ledger.Alonzo.Imp.UtxoSpec
120122
Test.Cardano.Ledger.Alonzo.Imp.UtxosSpec
@@ -148,14 +150,16 @@ library testlib
148150
cardano-data:{cardano-data, testlib},
149151
cardano-ledger-allegra,
150152
cardano-ledger-alonzo,
151-
cardano-ledger-binary,
153+
cardano-ledger-binary:{cardano-ledger-binary, testlib},
152154
cardano-ledger-core:{cardano-ledger-core, testlib},
153155
cardano-ledger-mary:{cardano-ledger-mary, testlib},
154156
cardano-ledger-shelley:{cardano-ledger-shelley, testlib},
155157
cardano-slotting,
156158
cardano-strict-containers,
159+
cborg,
157160
containers,
158161
cuddle >=0.4,
162+
data-default,
159163
generic-random,
160164
heredoc,
161165
microlens,
@@ -213,10 +217,12 @@ test-suite tests
213217
hs-source-dirs: test
214218
other-modules:
215219
Paths_cardano_ledger_alonzo
220+
Test.Cardano.Ledger.Alonzo.Binary.CanonicalSpec
216221
Test.Cardano.Ledger.Alonzo.Binary.CddlSpec
217222
Test.Cardano.Ledger.Alonzo.BinarySpec
218223
Test.Cardano.Ledger.Alonzo.GoldenSpec
219224
Test.Cardano.Ledger.Alonzo.GoldenTranslation
225+
Test.Cardano.Ledger.Alonzo.TxInfoSpec
220226

221227
default-language: Haskell2010
222228
ghc-options:
@@ -233,10 +239,18 @@ test-suite tests
233239

234240
build-depends:
235241
HUnit,
242+
QuickCheck,
236243
base,
244+
base16-bytestring,
245+
bytestring,
237246
cardano-ledger-allegra,
238247
cardano-ledger-alonzo,
239-
cardano-ledger-binary:testlib,
248+
cardano-ledger-binary:{cardano-ledger-binary, testlib},
240249
cardano-ledger-core:{cardano-ledger-core, testlib},
241250
cardano-ledger-shelley:testlib,
251+
cardano-slotting,
252+
cardano-strict-containers,
253+
containers,
254+
plutus-ledger-api,
242255
testlib,
256+
time,

0 commit comments

Comments
 (0)