Skip to content

Commit 8e2bba9

Browse files
authored
Merge pull request #304 from tweag/bump-cuddle-1.8.0.0
Bump `cuddle` to `1.8.0.0`
2 parents 310a407 + b6d8538 commit 8e2bba9

8 files changed

Lines changed: 20 additions & 16 deletions

File tree

flake.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scls-cardano/cddl-validate/Cardano/SCLS/CDDL/Validate.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,6 @@ validSpecs :: Map.Map SomeNamespaceSymbol (CTreeRoot Codec.CBOR.Cuddle.CDDL.Reso
4949
validateBytesAgainst :: ByteString -> Text -> Text -> Maybe (Evidenced ValidationTrace)
5050
validateBytesAgainst bytes namespace name = do
5151
cddl <- namespaceSymbolFromText namespace >>= flip Map.lookup validSpecs
52-
pure $ validateCBOR bytes (Name name) (mapIndex cddl)
52+
case validateCBOR bytes (Name name) (mapIndex cddl) of
53+
Right res -> pure res
54+
Left _ -> Nothing

scls-cardano/scls-cardano.cabal

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ library
4848
build-depends:
4949
base >=4.18 && <5,
5050
containers,
51-
cuddle >=1.7,
51+
cuddle >=1.8,
5252
heredoc >=0.2,
5353
scls-core,
5454
text,
@@ -68,7 +68,7 @@ library validate
6868
base >=4.18 && <5,
6969
bytestring,
7070
containers,
71-
cuddle >=1.7,
71+
cuddle >=1.8,
7272
scls-cardano,
7373
scls-core,
7474
text,
@@ -90,7 +90,7 @@ library testlib
9090
base16-bytestring,
9191
bytestring,
9292
cborg,
93-
cuddle >=1.7,
93+
cuddle >=1.8,
9494
hspec,
9595
hspec-expectations,
9696
scls-cardano:{validate},
@@ -108,7 +108,7 @@ executable gen-cddl
108108
main-is: Main.hs
109109
build-depends:
110110
base >=4.18 && <5,
111-
cuddle >=1.7,
111+
cuddle >=1.8,
112112
directory >=1,
113113
filepath >=1.4,
114114
prettyprinter,
@@ -134,7 +134,7 @@ test-suite scls-cardano-test
134134
bytestring,
135135
cborg,
136136
containers,
137-
cuddle >=1.7,
137+
cuddle >=1.8,
138138
directory,
139139
filepath,
140140
hspec,

scls-cardano/test/Conformance.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ propReferenceAcceptsCBOR genSpec validateSpec direction = do
6666

6767
let result = validateCBOR cbor (Name (T.pack "record_entry")) (mapIndex validateSpec)
6868
case result of
69-
Evidenced SValid _ ->
69+
Left e -> pure $ Left $ FailureInfo direction (TE.decodeUtf8 $ Base16.encode cbor) (T.pack $ show e)
70+
Right (Evidenced SValid _) ->
7071
pure $ Right ()
71-
Evidenced SInvalid trc ->
72+
Right (Evidenced SInvalid trc) ->
7273
pure $ Left $ FailureInfo direction (TE.decodeUtf8 $ Base16.encode cbor) (T.pack $ showValidationTrace trc)

scls-core/scls-core.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@ library
4343
base >=4.18 && <5,
4444
bytestring,
4545
cborg,
46-
cuddle >=1.7,
46+
cuddle >=1.8,
4747
mempack-scls,

scls-format/scls-format.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ test-suite scls-format-test
117117
cborg >=0.2,
118118
containers,
119119
crypton,
120-
cuddle >=1.7,
120+
cuddle >=1.8,
121121
filepath,
122122
hspec,
123123
hspec-expectations,

scls-util/scls-util.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ library
4444
cborg,
4545
containers,
4646
crypton,
47-
cuddle >=1.7,
47+
cuddle >=1.8,
4848
directory,
4949
filepath,
5050
mempack-scls,

scls-util/src/Cardano/SCLS/Util/Verify.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,9 @@ validateCDDLAgainst :: CTreeRoot MonoReferenced -> (Int, GenericCBOREntry n) ->
245245
validateCDDLAgainst cddl (seqNum, GenericCBOREntry (ChunkEntry _key cTerm)) =
246246
let name = Name (T.pack "record_entry")
247247
in case validateCBOR (getEncodedBytes cTerm) name (mapIndex cddl) of
248-
Evidenced SValid _ -> Nothing
249-
Evidenced SInvalid trc -> Just (CDDLValidationError seqNum trc)
248+
Left e -> Just (CBORParseError seqNum . T.pack $ show e)
249+
Right (Evidenced SValid _) -> Nothing
250+
Right (Evidenced SInvalid trc) -> Just (CDDLValidationError seqNum trc)
250251

251252
-- | Format an error for display.
252253
formatError :: CheckError -> String

0 commit comments

Comments
 (0)