Add a Mismatch
type to be used for predicate failures
#4619
Labels
enhancement
New feature or request
serialization
Anything that affects serialization of ledger types
One of the most common patterns in predicate failures is reporting a mismatched value. It is usually tricky to infer from the predicate failure which value was the expected value and which one was supplied by the user. There is also no guarantee that the order between the predicates will be consistent, leading to more confusion The proper Haskell solution for this is to add a type for this:
Adding the type is the easiest part of this task. Second part is to use it for all predicate failures that we have right now.
It is very important to not mess up serialization of
Conway
predicate failures, since that is the live era and we can't break the nope-to-client communication protocol. Prior eras do not have this problem anymore, as long as those predicate failures are not used in Conway. For the cases where predicate failures are still being used, we need to carefully adjust the encoders/decoders to keep them backwards compatible, while switching to using theMismatch
type.The text was updated successfully, but these errors were encountered: