How can I specify input data of type map, where the key is a record, in Dazl?
App Development3 posts1,369 views1 likesLast activity Aug 2022
GY
gyorgybalazsiOP
Aug 2022It seems that Dazl represents Daml map data as Python dict, although this is not listed in the Dazl docs on the page “Mapping Daml types to Python types”: Basics
The problem is that in Python dicts are not hashable, so a dict key cannot be a dict.
Daml doesn’t use hash table for maps, so in Daml a record can be key in a map.
Do you know any solution for this problem?
CO
cocreature
Aug 2022You can see a hint in the protobuf decoder in dazl. So if you wrap your dict in a FrozenDict you should be good.
GY
gyorgybalazsi
Aug 2022Thanks, will try.