Skip to content

Commit d48965e

Browse files
committed
Expose Byron CDDLs in Test.Cardano.Chain.Binary.Cddl
1 parent c71ea13 commit d48965e

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ description: The blockchain layer of Cardano during the Byron era
99
category: Currency
1010
build-type: Simple
1111
data-files:
12+
cddl-spec/byron.cddl
1213
golden/cbor/block/BlockSignature
1314
golden/cbor/block/Body
1415
golden/cbor/block/BoundaryBlockHeader
@@ -265,6 +266,7 @@ library
265266

266267
library testlib
267268
exposed-modules:
269+
Test.Cardano.Chain.Binary.Cddl
268270
Test.Cardano.Chain.Block.CBOR
269271
Test.Cardano.Chain.Block.Gen
270272
Test.Cardano.Chain.Block.Model
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{-# LANGUAGE ImplicitPrelude #-}
2+
3+
module Test.Cardano.Chain.Binary.Cddl (
4+
readByronCddlFileNames,
5+
readByronCddlFiles,
6+
) where
7+
8+
import qualified Data.ByteString.Lazy as BSL
9+
import Paths_cardano_ledger_byron
10+
11+
readByronCddlFileNames :: IO [FilePath]
12+
readByronCddlFileNames = do
13+
base <- getDataFileName "cddl-spec/byron.cddl"
14+
pure [base]
15+
16+
readByronCddlFiles :: IO [BSL.ByteString]
17+
readByronCddlFiles = mapM BSL.readFile =<< readByronCddlFileNames

0 commit comments

Comments
 (0)