Decoding Map from Ledger behaviour #737
Closed
KristianBalaj
started this conversation in
Core language features
Replies: 2 comments
-
At the moment you can still deserialise right to an opaque type (eg Dict) but this is something we are going to forbid at the typechecker level precisely for the reason you indicate. The correct way to lift into an opaque type is to use the smart constructors it provides which will either enforce (from_list) or check (from_ascending_list) the invariants. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Will have a resolution when #564 is added as a feature. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm not sure whether this is more of an stdlib or aiken's discussion, but I'm more inclined for it to be placed here.
I'm curious what happens when there's a Map onchain e.g. in some datum that has it's items unordered. Aiken's stdlib
Dict
has an invariant that its items has to be ordered. When the datum is used by Aiken written validator that uses theDict
type, it will be loaded breaking the invariant am I right - i.e. the internal representation of theDict
will be unordered and so breaking theDict
related stdlib functions?Beta Was this translation helpful? Give feedback.
All reactions