Skip to content

Commit 3a986b4

Browse files
authored
Merge pull request #4956 from IntersectMBO/td/convert-byron-test-packages
Convert byron test packages to sublibraries
2 parents 4b914b5 + 3065f85 commit 3a986b4

File tree

201 files changed

+296
-790
lines changed

Some content is hidden

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

201 files changed

+296
-790
lines changed

RELEASING.md

-2
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,6 @@ but the changelog _only_ needs to indicate if breaking changes have been made:
334334
* `cardano-ledger-alonzo-test`
335335
* `cardano-ledger-babbage-test`
336336
* `cardano-ledger-conway-test`
337-
* `cardano-crypto-test`
338-
* `cardano-ledger-byron-test`
339337

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

REVISIONING.md

-10
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,7 @@ Next, you will add the actual revisions and test if you can build your packages
7272
'.#"ghc96/byron-spec-chain/1.0.0.2"' \
7373
'.#"ghc96/byron-spec-ledger/1.0.0.2"' \
7474
'.#"ghc96/cardano-ledger-byron/1.0.0.4"' \
75-
'.#"ghc96/cardano-ledger-byron-test/1.5.0.1"' \
7675
'.#"ghc96/cardano-crypto-wrapper/1.5.1.1"' \
77-
'.#"ghc96/cardano-crypto-test/1.5.0.1"' \
7876
'.#"ghc96/cardano-ledger-conway/1.12.0.0"' \
7977
'.#"ghc96/cardano-ledger-conway-test/1.2.1.3"' \
8078
'.#"ghc96/cardano-ledger-mary/1.5.0.0"' \
@@ -120,9 +118,7 @@ Next, you will add the actual revisions and test if you can build your packages
120118
'.#"ghc96/byron-spec-chain/1.0.0.2"' \
121119
'.#"ghc96/byron-spec-ledger/1.0.0.2"' \
122120
'.#"ghc96/cardano-ledger-byron/1.0.0.4"' \
123-
'.#"ghc96/cardano-ledger-byron-test/1.5.0.1"' \
124121
'.#"ghc96/cardano-crypto-wrapper/1.5.1.1"' \
125-
'.#"ghc96/cardano-crypto-test/1.5.0.1"' \
126122
'.#"ghc96/cardano-ledger-conway/1.12.0.0"' \
127123
'.#"ghc96/cardano-ledger-conway-test/1.2.1.3"' \
128124
'.#"ghc96/cardano-ledger-mary/1.5.0.0"' \
@@ -169,9 +165,7 @@ extra-packages:
169165
byron-spec-chain-1.0.0.2,
170166
byron-spec-ledger-1.0.0.2,
171167
cardano-ledger-byron-1.0.0.4,
172-
cardano-ledger-byron-test-1.5.0.1,
173168
cardano-crypto-wrapper-1.5.1.1,
174-
cardano-crypto-test-1.5.0.1,
175169
cardano-ledger-conway-1.12.0.0,
176170
cardano-ledger-conway-test-1.2.1.3,
177171
cardano-ledger-mary-1.5.0.0,
@@ -211,9 +205,7 @@ library
211205
byron-spec-chain \
212206
byron-spec-ledger \
213207
cardano-ledger-byron \
214-
cardano-ledger-byron-test \
215208
cardano-crypto-wrapper \
216-
cardano-crypto-test \
217209
cardano-ledger-conway \
218210
cardano-ledger-conway-test \
219211
cardano-ledger-mary \
@@ -260,9 +252,7 @@ library
260252
byron-spec-chain \
261253
byron-spec-ledger \
262254
cardano-ledger-byron \
263-
cardano-ledger-byron-test \
264255
cardano-crypto-wrapper \
265-
cardano-crypto-test \
266256
cardano-ledger-conway \
267257
cardano-ledger-conway-test \
268258
cardano-ledger-mary \

cabal.project

-4
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ packages:
2929
-- byron-spec-chain:
3030
-- byron-spec-ledger:
3131
-- cardano-ledger-byron:
32-
-- cardano-ledger-byron-test:
3332
-- cardano-crypto-wrapper:
34-
-- cardano-crypto-test:
3533
-- Packages used during development and are not released to CHaPs:
3634
eras/allegra/impl
3735
eras/alonzo/impl
@@ -56,9 +54,7 @@ packages:
5654
eras/byron/chain/executable-spec
5755
eras/byron/ledger/executable-spec
5856
eras/byron/ledger/impl
59-
eras/byron/ledger/impl/test
6057
eras/byron/crypto
61-
eras/byron/crypto/test
6258
libs/cardano-ledger-conformance
6359
libs/cardano-ledger-test
6460
libs/plutus-preprocessor

eras/byron/crypto/CHANGELOG.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Revision history for `cardano-crypto-wrapper`
22

3-
## 1.6.0.1
3+
## 1.6.1.0
44

5-
*
5+
### `testlib`
6+
7+
* Added `testlib` sublibrary as replacement of `cardano-crypto-test` package
68

79
## 1.6.0.0
810

eras/byron/crypto/cardano-crypto-wrapper.cabal

+60-29
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: 3.0
22
name: cardano-crypto-wrapper
3-
version: 1.6.0.0
3+
version: 1.6.1.0
44
license: Apache-2.0
55
maintainer: [email protected]
66
author: IOHK
@@ -13,24 +13,24 @@ description:
1313
category: Currency
1414
build-type: Simple
1515
data-files:
16-
test/golden/AbstractHash
17-
test/golden/DecShare
18-
test/golden/EncShare
19-
test/golden/PassPhrase
20-
test/golden/RedeemSignature
21-
test/golden/RedeemSigningKey
22-
test/golden/RedeemVerificationKey
23-
test/golden/Secret
24-
test/golden/SecretProof
25-
test/golden/Signature
26-
test/golden/SigningKey
27-
test/golden/VerificationKey
28-
test/golden/VssPublicKey
29-
test/golden/json/ProtocolMagic0_Legacy_HasNetworkMagic
30-
test/golden/json/ProtocolMagic1_Legacy_HasNetworkMagic
31-
test/golden/json/ProtocolMagic2_Legacy_HasNetworkMagic
32-
test/golden/json/ProtocolMagic_Legacy_NMMustBeJust
33-
test/golden/json/ProtocolMagic_Legacy_NMMustBeNothing
16+
golden/AbstractHash
17+
golden/DecShare
18+
golden/EncShare
19+
golden/PassPhrase
20+
golden/RedeemSignature
21+
golden/RedeemSigningKey
22+
golden/RedeemVerificationKey
23+
golden/Secret
24+
golden/SecretProof
25+
golden/Signature
26+
golden/SigningKey
27+
golden/VerificationKey
28+
golden/VssPublicKey
29+
golden/json/ProtocolMagic0_Legacy_HasNetworkMagic
30+
golden/json/ProtocolMagic1_Legacy_HasNetworkMagic
31+
golden/json/ProtocolMagic2_Legacy_HasNetworkMagic
32+
golden/json/ProtocolMagic_Legacy_NMMustBeJust
33+
golden/json/ProtocolMagic_Legacy_NMMustBeNothing
3434

3535
extra-source-files:
3636
CHANGELOG.md
@@ -98,22 +98,54 @@ library
9898
nothunks,
9999
text,
100100

101+
library testlib
102+
exposed-modules:
103+
Test.Cardano.Crypto.CBOR
104+
Test.Cardano.Crypto.Dummy
105+
Test.Cardano.Crypto.Example
106+
Test.Cardano.Crypto.Gen
107+
Test.Cardano.Crypto.Json
108+
Test.Cardano.Crypto.Orphans
109+
110+
visibility: public
111+
hs-source-dirs: testlib
112+
other-modules:
113+
Paths_cardano_crypto_wrapper
114+
115+
default-language: Haskell2010
116+
default-extensions: NoImplicitPrelude
117+
ghc-options:
118+
-Weverything
119+
-Wno-all-missed-specialisations
120+
-Wno-missing-deriving-strategies
121+
-Wno-missing-import-lists
122+
-Wno-missing-safe-haskell-mode
123+
-Wno-prepositive-qualified-module
124+
-Wno-safe
125+
-Wno-unsafe
126+
-Wunused-packages
127+
128+
build-depends:
129+
base,
130+
bytestring,
131+
cardano-crypto,
132+
cardano-crypto-wrapper,
133+
cardano-ledger-binary:{cardano-ledger-binary, testlib},
134+
cardano-prelude,
135+
cardano-prelude-test,
136+
crypton,
137+
hedgehog >=1.0.4,
138+
memory,
139+
101140
test-suite test
102141
type: exitcode-stdio-1.0
103142
main-is: test.hs
104143
hs-source-dirs: test
105144
other-modules:
106-
GetDataFileName
107145
Paths_cardano_crypto_wrapper
108-
Test.Cardano.Crypto.CBOR
109-
Test.Cardano.Crypto.Dummy
110-
Test.Cardano.Crypto.Example
111-
Test.Cardano.Crypto.Gen
112146
Test.Cardano.Crypto.Hashing
113-
Test.Cardano.Crypto.Json
114147
Test.Cardano.Crypto.Keys
115148
Test.Cardano.Crypto.Limits
116-
Test.Cardano.Crypto.Orphans
117149
Test.Cardano.Crypto.Random
118150
Test.Cardano.Crypto.Signing.Redeem
119151
Test.Cardano.Crypto.Signing.Redeem.Compact
@@ -140,11 +172,10 @@ test-suite test
140172
bytestring,
141173
cardano-crypto,
142174
cardano-crypto-wrapper,
143-
cardano-ledger-binary:{cardano-ledger-binary, testlib},
175+
cardano-ledger-binary,
144176
cardano-prelude,
145177
cardano-prelude-test,
146178
crypton,
147-
filepath,
148179
formatting,
149180
hedgehog >=1.0.4,
150-
memory,
181+
testlib,

eras/byron/crypto/test/.ghcid

-1
This file was deleted.

eras/byron/crypto/test/CHANGELOG.md

-37
This file was deleted.

eras/byron/crypto/test/GetDataFileName.hs

-37
This file was deleted.

eras/byron/crypto/test/Test/Cardano/Crypto/Hashing.hs

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ prop_hashInequalityUnitList =
4444

4545
prop_hashInequalityListOfList :: Property
4646
prop_hashInequalityListOfList =
47-
hashInequality $
48-
Gen.list
47+
hashInequality
48+
$ Gen.list
4949
(Range.constant 0 10)
5050
(Gen.list (Range.constant 0 20) (Gen.maybe $ Gen.int Range.constantBounded))
5151

@@ -55,7 +55,7 @@ prop_goldenHash =
5555
withTests 1
5656
. property
5757
$ sformat hashHexF (serializeCborHash (1 :: Word64))
58-
=== "ee155ace9c40292074cb6aff8c9ccdd273c81648ff1149ef36bcea6ebb8a3e25"
58+
=== "ee155ace9c40292074cb6aff8c9ccdd273c81648ff1149ef36bcea6ebb8a3e25"
5959

6060
-- | Check that 'decodeAbstractHash' correctly decodes hash values
6161
prop_decodeAbstractHash :: Property

eras/byron/crypto/test/Test/Cardano/Crypto/Signing/Redeem.hs

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ prop_redeemSign = property $ do
4646
(vk, sk) <- forAll genRedeemKeypair
4747
a <- forAll genData
4848

49-
assert $
50-
verifyRedeemSig Dummy.protocolMagicId SignForTestingOnly vk a $
51-
redeemSign Dummy.protocolMagicId SignForTestingOnly sk a
49+
assert
50+
$ verifyRedeemSig Dummy.protocolMagicId SignForTestingOnly vk a
51+
$ redeemSign Dummy.protocolMagicId SignForTestingOnly sk a
5252

5353
-- | Signing fails when the wrong 'RedeemVerificationKey' is used
5454
prop_redeemSignDifferentKey :: Property

eras/byron/crypto/test/Test/Cardano/Crypto/Signing/Signing.hs

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ prop_sign = property $ do
4040
(vk, sk) <- forAll genKeypair
4141
a <- forAll genData
4242

43-
assert $
44-
verifySignature encCBOR Dummy.protocolMagicId SignForTestingOnly vk a $
45-
sign Dummy.protocolMagicId SignForTestingOnly sk a
43+
assert
44+
$ verifySignature encCBOR Dummy.protocolMagicId SignForTestingOnly vk a
45+
$ sign Dummy.protocolMagicId SignForTestingOnly sk a
4646

4747
-- | Signing fails when the wrong 'VerificationKey' is used
4848
prop_signDifferentKey :: Property

0 commit comments

Comments
 (0)