File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
src/Codec/CBOR/Cuddle/CBOR Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 1
1
cabal-version : 3.4
2
2
name : cuddle
3
- version : 0.1.9 .0
3
+ version : 0.1.10 .0
4
4
synopsis : CDDL Generator and test utilities
5
5
6
6
-- description:
@@ -58,6 +58,7 @@ library
58
58
-- other-extensions:
59
59
build-depends :
60
60
, base ^>= 4.14.3.0 || ^>= 4.16.3.0 || ^>= 4.18.1.0 || ^>= 4.19.0.0
61
+ , base16-bytestring
61
62
, bytestring
62
63
, capability
63
64
, cborg
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ import System.Random.Stateful
54
54
randomM ,
55
55
uniformByteStringM ,
56
56
)
57
+ import qualified Data.ByteString.Base16 as Base16
57
58
58
59
--------------------------------------------------------------------------------
59
60
-- Generator infrastructure
@@ -383,7 +384,9 @@ genValue (VFloat16 i) = pure . THalf $ i
383
384
genValue (VFloat32 i) = pure . TFloat $ i
384
385
genValue (VFloat64 i) = pure . TDouble $ i
385
386
genValue (VText t) = pure $ TString t
386
- genValue (VBytes b) = pure $ TBytes b
387
+ genValue (VBytes b) = case Base16. decode b of
388
+ Right bHex -> pure $ TBytes bHex
389
+ Left err -> error $ " Unable to parse hex encoded bytestring: " <> err
387
390
388
391
--------------------------------------------------------------------------------
389
392
-- Generator functions
You can’t perform that action at this time.
0 commit comments