Fix blueprint pairs schema generation #1089
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This ensures that we only prune unnecessary schema definitions from the blueprint when they truly are unnecessary. The first commit fixes #1086, but as we discussed internally, there's another problem we should find a resolution for (which I wish to include in this PR): currently, we generate schema for pairs as
#pairs
; which translates to a UPLC Term (not serializable as Data).So my first reaction was to simply forbid the presence of pairs in the contract ABI, but @MicroProofs pointed that part of the validator wrapper code includes conversion from lists of 2 elements to pairs (if types require it). Which means that pairs are technically allowed in the contract ABI, but serialized as Data::List of two elements.
Hence, the generated schema should reflect that; but only when pairs are present in datums / redeemers. When present as parameters, they are expected to be UPLC terms.