File tree 2 files changed +42
-0
lines changed 2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -138,6 +138,22 @@ jobs:
138
138
- name : Build projects [build]
139
139
run : cabal build all -j
140
140
141
+ - name : Install cddlc
142
+ run : gem install cddlc
143
+
144
+ - name : Clone cuddle with validator
145
+ uses : actions/checkout
146
+ with :
147
+ repo : ' input-output-hk/cuddle'
148
+ ref : ' js/validator'
149
+ path : ' cuddle'
150
+
151
+ - name : Install cuddle
152
+ run : |
153
+ ( cd $GITHUB_WORKSPACE/cuddle
154
+ cabal install --ignore-project exe:cuddle
155
+ )
156
+
141
157
- name : Test
142
158
if : matrix.test-set == 'all'
143
159
run : cabal test all -j --test-show-details=streaming
Original file line number Diff line number Diff line change
1
+ {- cabal:
2
+ build-depends: cborg, bytestring, base
3
+ -}
4
+
5
+ -- | A simple script that unwraps a CBOR term serialized as
6
+ -- CBOR-in-CBOR. It gets input from stdin and emits on stdout.
7
+ --
8
+ -- > cat pre.cbor | cabal run ./scripts/unwrap24serialised.hs > post.cbor
9
+ module Main where
10
+
11
+ import Prelude hiding (interact )
12
+ import Data.ByteString
13
+ import Codec.CBOR.Term
14
+ import Codec.CBOR.Write
15
+ import Codec.CBOR.Read
16
+ import Data.ByteString.Lazy (fromStrict , toStrict )
17
+
18
+ main = interact $
19
+ toStrict
20
+ . toLazyByteString
21
+ . encodeTerm
22
+ . (\ (Right (_, t)) -> t)
23
+ . deserialiseFromBytes decodeTerm
24
+ . (\ (Right (_, TTagged _ (TBytes t))) -> fromStrict t)
25
+ . deserialiseFromBytes decodeTerm
26
+ . fromStrict
You can’t perform that action at this time.
0 commit comments