simplicity
simplicity copied to clipboard
Improve description of SIMPLICITY_ERR_HIDDEN
https://github.com/BlockstreamResearch/simplicity/blob/5e7976326156ac9db9b5f8695dd597e8e370e130/C/deserialize.c#L46
It is unclear what illegal children are.
Non-case nodes may not have hidden children, so these children are illegal. However, a case node may not have two hidden children, so these children are also illegal. SIMPLICITY_ERR_HIDDEN is returned in both cases.
HIDDEN children are illegal if they don't occur as part of an assertion.
Agreed, this text should be improved.
illegal HIDDEN children is formally defined in https://github.com/BlockstreamResearch/simplicity/blob/5e7976326156ac9db9b5f8695dd597e8e370e130/C/dag.h#L308-L314 (technically that defines legal HIDDEN children).
I suppose I can break the various conditions of well-formedness into their own names. But I'm not going to copy the entire formal definition into the error message.
Let me see what I can do.
Maybe "The parent of a hidden node is not an assertion." Assertions are defined to be case nodes with one left or right hidden child.