diff --git a/scls-cardano/cddl-src/Cardano/SCLS/CDDL.hs b/scls-cardano/cddl-src/Cardano/SCLS/CDDL.hs index f0c0b917..6f277616 100644 --- a/scls-cardano/cddl-src/Cardano/SCLS/CDDL.hs +++ b/scls-cardano/cddl-src/Cardano/SCLS/CDDL.hs @@ -115,12 +115,12 @@ type instance Spec.NamespaceKeySize "nonces/v0" = 1 -- Just zero type instance Spec.NamespaceKeySize "snapshots/mark/v0" = 31 -- 1 byte for hash type, 29 bytes for key hash (including 1-byte discriminator/padding; cred 29, key 28+1), 1 byte for value type type instance Spec.NamespaceKeySize "snapshots/set/v0" = 31 -- 1 byte for hash type, 29 bytes for key hash (including 1-byte discriminator/padding; cred 29, key 28+1), 1 byte for value type type instance Spec.NamespaceKeySize "snapshots/go/v0" = 31 -- 1 byte for hash type, 29 bytes for key hash (including 1-byte discriminator/padding; cred 29, key 28+1), 1 byte for value type -type instance Spec.NamespaceKeySize "entities/committee/v0" = 8 +type instance Spec.NamespaceKeySize "entities/committee/v0" = 1 -- One-byte zero, as it's a singleton key type instance Spec.NamespaceKeySize "entities/dreps/v0" = 29 -- 1 byte for tag, 28 bytes for hash type instance Spec.NamespaceKeySize "entities/stake_pools/v0" = 28 type instance Spec.NamespaceKeySize "entities/stake_pools/vrf_key_hashes/v0" = 32 -type instance Spec.NamespaceKeySize "gov/committee/v0" = 8 -type instance Spec.NamespaceKeySize "gov/constitution/v0" = 8 +type instance Spec.NamespaceKeySize "gov/committee/v0" = 1 -- One-byte zero, as it's a singleton key +type instance Spec.NamespaceKeySize "gov/constitution/v0" = 1 -- One-byte zero, as it's a singleton key type instance Spec.NamespaceKeySize "gov/pparams/v0" = 4 type instance Spec.NamespaceKeySize "gov/proposals/v0" = 34 -- 32 bytes txid+tx index + 2 bytes for proposal index type instance Spec.NamespaceKeySize "gov/proposals/roots/v0" = 1 -- 1 byte for proposal purpose diff --git a/scls-cardano/cddl-src/Cardano/SCLS/Namespace/EntitiesCommittee.hs b/scls-cardano/cddl-src/Cardano/SCLS/Namespace/EntitiesCommittee.hs index d0662fe7..886ad310 100644 --- a/scls-cardano/cddl-src/Cardano/SCLS/Namespace/EntitiesCommittee.hs +++ b/scls-cardano/cddl-src/Cardano/SCLS/Namespace/EntitiesCommittee.hs @@ -30,9 +30,10 @@ record_entry = | types: | entities_committee: | seq: - | - id: epoch - | doc: epoch - | type: u8 + | - id: singleton + | doc: singleton key with value 0 + | type: u1 + |. valid: 0 | ``` |] $ "record_entry" =:= committee_state diff --git a/scls-cardano/cddl-src/Cardano/SCLS/Namespace/GovCommittee.hs b/scls-cardano/cddl-src/Cardano/SCLS/Namespace/GovCommittee.hs index 62e38e44..8f712823 100644 --- a/scls-cardano/cddl-src/Cardano/SCLS/Namespace/GovCommittee.hs +++ b/scls-cardano/cddl-src/Cardano/SCLS/Namespace/GovCommittee.hs @@ -30,9 +30,10 @@ record_entry = | types: | gov_committee: | seq: - | - id: epoch - | doc: epoch - | type: u8 + | - id: singleton + | doc: singleton key with value 0 + | type: u1 + |. valid: 0 | ``` |] $ "record_entry" =:= committee / VNil diff --git a/scls-cardano/cddl-src/Cardano/SCLS/Namespace/GovConstitution.hs b/scls-cardano/cddl-src/Cardano/SCLS/Namespace/GovConstitution.hs index 5b0db1d1..f2eab8ce 100644 --- a/scls-cardano/cddl-src/Cardano/SCLS/Namespace/GovConstitution.hs +++ b/scls-cardano/cddl-src/Cardano/SCLS/Namespace/GovConstitution.hs @@ -26,11 +26,13 @@ record_entry = | - id: key | type: gov_constitution | - | gov_constitution: - | seq: - | - id: epoch - | doc: Current epoch. - | type: u8 + | types: + | gov_constitution: + | seq: + | - id: singleton + | doc: singleton key with value 0 + | type: u1 + |. valid: 0 | ``` |] $ "record_entry" =:= constitution