IntersectMBO / IntersectMBO/cardano-ledger
Mention if duplicates are allowed in maps in the CDDL files
- Dominant language
- Haskell
- Stars
- 295
- Forks
- 179
- Avg merge
- 4d 7h
- Merged PRs (30d)
- 29
Description
In `conway.cddl`, there are many types which are maps.
As per CDDL spec, maps are allowed to have duplicate keys.
But the node doesn't allow duplicate keys in some places, and allows in some other places.
For example, the multiasset type is defined as a map:
https://github.com/IntersectMBO/cardano-ledger/blob/28ab3884cac8edbb7270fd4b8628a16429d2ec9e/eras/conway/impl/cddl-files/conway.cddl#L564
The mint type, which is an instance of multiasset, can have duplicate keys.
https://github.com/IntersectMBO/cardano-ledger/blob/28ab3884cac8edbb7270fd4b8628a16429d2ec9e/eras/conway/impl/cddl-files/conway.cddl#L576
But the multiasset field of the value type can't have.
https://github.com/IntersectMBO/cardano-ledger/blob/28ab3884cac8edbb7270fd4b8628a16429d2ec9e/eras/conway/impl/cddl-files/conway.cddl#L574
It would be helpful for library/tools authors to have comments in the CDDL file around map types, describing whether duplicate keys are allowed or not.
Contributor guide
Assessment
This issue has not been assessed yet.