You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What operating system are you using, and which version?
macOS
Describe what the problem is?
When creating a datum type containing an alias for a Pair and an associative list using the same type alias, only the schema definition for the associative list gets included in the generated blueprint when executing aiken build.
Example
When building this simple validator:
use cardano/transaction.{OutputReference,Transaction}pubtypeMyPair = Pair<Int,Int>pubtypeMyDatum{
pair:MyPair,
pairs:List<MyPair>,}
validator placeholder {
spend(_datum:Option<MyDatum>,_redeemer:Void,_utxo:OutputReference,_self:Transaction){True}}
...the resulting schema for the datum fields is as follows:
This is to avoid pruning a definition which may end up needed later
on. The issue can be seen when definition to a Pair is used *before*
another Map definitions that uses this same Pair.
Before this commit, the Map definition would simply remove the
definition generated for the Pair, since it would be pointless (and it
is a lot easier to generate those pointless definition than trying to
remember we are currently generating definition for a Map).
So now, we defer the removal of the orphan definition to after all
defnitions have been generated by basically looking at a dependency
graph. I _could have_ used pet-graph on this to solve it similar to
how we do package dependencies; but given that we only really need to
that for pairs, the problem is relatively simple to solve (though
cumbersome since we need to traverse all defintions).
Fixes#1086.
What Git revision are you using?
aiken v1.1.10+b25afa2
What operating system are you using, and which version?
Describe what the problem is?
When creating a datum type containing an alias for a
Pair
and an associative list using the same type alias, only the schema definition for the associative list gets included in the generated blueprint when executingaiken build
.Example
When building this simple validator:
...the resulting schema for the datum fields is as follows:
...but there is no definition for the
MyPair
type, only for theList$MyPair
.Is this expected? I could infer the
MyPair
type from theList$MyPair
schema but it feels like a weird edge case.What should be the expected behavior?
I would expect all
$ref
paths to point to a schema definition.plutus.json
The text was updated successfully, but these errors were encountered: