{-# LANGUAGE ImportQualifiedPost #-}
{-# LANGUAGE OverloadedLists #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -Wno-unrecognised-pragmas #-}
{-# HLINT ignore "Use camelCase" #-}
module Cardano.Ledger.CanonicalState.Namespace.EntitiesCommittee.V0.CDDL where
import Cardano.Ledger.CanonicalState.Namespace.CDDL.Common
import Codec.CBOR.Cuddle.Huddle
import Data.Function (($))
import Text.Heredoc (str)
record_entry :: Rule
record_entry :: Rule
record_entry =
Comment -> Rule -> Rule
forall a. HasComment a => Comment -> a -> a
comment
Comment
[str| The key for the namespace
|
| ```
| meta:
| endian: be
|
| seq:
| - id: key
| type: entities_committee
|
| types:
| entities_committee:
| seq:
| - id: singleton
| doc: singleton key with value 0
| type: u1
| valid: 0
| ```
|]
(Rule -> Rule) -> Rule -> Rule
forall a b. (a -> b) -> a -> b
$ Name
"record_entry" Name -> Rule -> Rule
forall a. IsType0 a => Name -> a -> Rule
=:= Rule
committee_state
committee_state :: Rule
committee_state :: Rule
committee_state =
Comment -> Rule -> Rule
forall a. HasComment a => Comment -> a -> a
comment
Comment
[str| Storage of the committee state
|]
(Rule -> Rule) -> Rule -> Rule
forall a b. (a -> b) -> a -> b
$ Name
"committee_state" Name -> MapChoice -> Rule
forall a. IsType0 a => Name -> a -> Rule
=:= (MapChoice -> MapChoice
mp [Word64
0 Word64 -> MapEntry -> MapEntry
forall a. CanQuantify a => Word64 -> a -> a
<+ Rule -> Key
forall r. IsType0 r => r -> Key
asKey Rule
credential Key -> Rule -> MapEntry
forall a me. (IsType0 a, IsEntryLike me) => Key -> a -> me
==> Rule
committee_authorization])
committee_authorization :: Rule
committee_authorization :: Rule
committee_authorization =
Comment -> Rule -> Rule
forall a. HasComment a => Comment -> a -> a
comment
Comment
[str| 0 - hot committee member
| 1 - resignation
|]
(Rule -> Rule) -> Rule -> Rule
forall a b. (a -> b) -> a -> b
$ Name
"committee_authorization"
Name -> Choice ArrayChoice -> Rule
forall a. IsType0 a => Name -> a -> Rule
=:= ArrayChoice -> ArrayChoice
arr [Item ArrayChoice
ArrayEntry
0, Rule -> ArrayEntry
forall a e. (IsType0 a, IsGroupOrArrayEntry e) => a -> e
a Rule
credential]
ArrayChoice -> ArrayChoice -> Choice ArrayChoice
forall a c b.
(IsChoosable a c, IsChoosable b c) =>
a -> b -> Choice c
/ ArrayChoice -> ArrayChoice
arr [Item ArrayChoice
ArrayEntry
1, Choice Type2 -> ArrayEntry
forall a e. (IsType0 a, IsGroupOrArrayEntry e) => a -> e
a (Rule
anchor Rule -> Value Void -> Choice Type2
forall a c b.
(IsChoosable a c, IsChoosable b c) =>
a -> b -> Choice c
/ Value Void
VNil)]