Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ jobs:
uses: actions/checkout@v6
with:
repository: tweag/CIPs
ref: 8b1b619bef7e11b37f21e2b39f3159ea5d48af23
ref: f88508eda28602bce250972c117cc7ec9ffcce99
path: cips
- name: set env for reference CDDL
run: |
Expand Down
14 changes: 7 additions & 7 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
inputs.nixpkgs.follows = "nixpkgs";
};
inputs.cips = {
url = "github:tweag/CIPs?rev=8b1b619bef7e11b37f21e2b39f3159ea5d48af23";
url = "github:tweag/CIPs?rev=f88508eda28602bce250972c117cc7ec9ffcce99";
flake = false;
};
outputs = { self, nixpkgs, flake-utils, haskellNix, git-hooks, treefmt-nix
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ record_entry =
| ```
|
|]
$ "record_entry" =:= arr [a word64, a proposal]
$ "record_entry" =:= mp ["order" ==> word64, "proposal" ==> proposal]

committee_cold_credential :: Rule
committee_cold_credential = "committee_cold_credential" =:= credential
Expand Down
4 changes: 1 addition & 3 deletions scls-cardano/cddl-validate/Cardano/SCLS/CDDL/Validate.hs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,4 @@ validSpecs :: Map.Map SomeNamespaceSymbol (CTreeRoot Codec.CBOR.Cuddle.CDDL.Reso
validateBytesAgainst :: ByteString -> Text -> Text -> Maybe (Evidenced ValidationTrace)
validateBytesAgainst bytes namespace name = do
cddl <- namespaceSymbolFromText namespace >>= flip Map.lookup validSpecs
case validateCBOR bytes (Name name) (mapIndex cddl) of
Right res -> pure res
Left _ -> Nothing
pure $ validateCBOR bytes (Name name) (mapIndex cddl)
10 changes: 5 additions & 5 deletions scls-cardano/scls-cardano.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ library
build-depends:
base >=4.18 && <5,
containers,
cuddle >=1.8,
cuddle >=1.7 && <1.8,
heredoc >=0.2,
scls-core,
text,
Expand All @@ -68,7 +68,7 @@ library validate
base >=4.18 && <5,
bytestring,
containers,
cuddle >=1.8,
cuddle >=1.7 && <1.8,
scls-cardano,
scls-core,
text,
Expand All @@ -90,7 +90,7 @@ library testlib
base16-bytestring,
bytestring,
cborg,
cuddle >=1.8,
cuddle >=1.7 && <1.8,
hspec,
hspec-expectations,
scls-cardano:{validate},
Expand All @@ -108,7 +108,7 @@ executable gen-cddl
main-is: Main.hs
build-depends:
base >=4.18 && <5,
cuddle >=1.8,
cuddle >=1.7 && <1.8,
directory >=1,
filepath >=1.4,
prettyprinter,
Expand All @@ -134,7 +134,7 @@ test-suite scls-cardano-test
bytestring,
cborg,
containers,
cuddle >=1.8,
cuddle >=1.7 && <1.8,
directory,
filepath,
hspec,
Expand Down
5 changes: 2 additions & 3 deletions scls-cardano/test/Conformance.hs
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ propReferenceAcceptsCBOR genSpec validateSpec direction = do

let result = validateCBOR cbor (Name (T.pack "record_entry")) (mapIndex validateSpec)
case result of
Left e -> pure $ Left $ FailureInfo direction (TE.decodeUtf8 $ Base16.encode cbor) (T.pack $ show e)
Right (Evidenced SValid _) ->
Evidenced SValid _ ->
pure $ Right ()
Right (Evidenced SInvalid trc) ->
Evidenced SInvalid trc ->
pure $ Left $ FailureInfo direction (TE.decodeUtf8 $ Base16.encode cbor) (T.pack $ showValidationTrace trc)
2 changes: 1 addition & 1 deletion scls-core/scls-core.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ library
base >=4.18 && <5,
bytestring,
cborg,
cuddle >=1.8,
cuddle >=1.7 && <1.8,
mempack-scls,
2 changes: 1 addition & 1 deletion scls-format/scls-format.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ test-suite scls-format-test
cborg >=0.2,
containers,
crypton,
cuddle >=1.8,
cuddle >=1.7 && <1.8,
filepath,
hspec,
hspec-expectations,
Expand Down
2 changes: 1 addition & 1 deletion scls-util/scls-util.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ library
cborg,
containers,
crypton,
cuddle >=1.8,
cuddle >=1.7 && <1.8,
directory,
filepath,
mempack-scls,
Expand Down
5 changes: 2 additions & 3 deletions scls-util/src/Cardano/SCLS/Util/Verify.hs
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,8 @@ validateCDDLAgainst :: CTreeRoot MonoReferenced -> (Int, GenericCBOREntry n) ->
validateCDDLAgainst cddl (seqNum, GenericCBOREntry (ChunkEntry _key cTerm)) =
let name = Name (T.pack "record_entry")
in case validateCBOR (getEncodedBytes cTerm) name (mapIndex cddl) of
Left e -> Just (CBORParseError seqNum . T.pack $ show e)
Right (Evidenced SValid _) -> Nothing
Right (Evidenced SInvalid trc) -> Just (CDDLValidationError seqNum trc)
Evidenced SValid _ -> Nothing
Evidenced SInvalid trc -> Just (CDDLValidationError seqNum trc)

-- | Format an error for display.
formatError :: CheckError -> String
Expand Down
Loading