Open SebastienGllmt opened 3 weeks ago
I am unable to reproduce this @SebastienGllmt?
With the following code:
pub type PairTest =
Pair<Int, ByteArray>
pub type Action {
PairTest { val: PairTest }
}
validator {
fn foo(redeemer: Action, ctx: Data) {
True
}
}
I end up with the following blueprint, which does contain a definition for Pair$Int_ByteArray
as expected:
{
"preamble": {
"title": "aiken-lang/scratchpad",
"description": "Aiken contracts for project 'aiken-lang/scratchpad'",
"version": "0.0.0",
"plutusVersion": "v2",
"compiler": {
"name": "Aiken",
"version": "v1.0.29-alpha+c52ba9c"
},
"license": "Apache-2.0"
},
"validators": [
{
"title": "scratchpad.foo",
"redeemer": {
"title": "redeemer",
"schema": {
"$ref": "#/definitions/scratchpad~1Action"
}
},
"compiledCode": "<redacted>",
"hash": "57689de1175e1f5de429ef7075211b7002a08c66034de7db5500ffb7"
}
],
"definitions": {
"ByteArray": {
"dataType": "bytes"
},
"Int": {
"dataType": "integer"
},
"Pair$Int_ByteArray": {
"title": "Pair",
"dataType": "#pair",
"left": {
"$ref": "#/definitions/Int"
},
"right": {
"$ref": "#/definitions/ByteArray"
}
},
"scratchpad/Action": {
"title": "Action",
"anyOf": [
{
"title": "PairTest",
"dataType": "constructor",
"index": 0,
"fields": [
{
"title": "val",
"$ref": "#/definitions/Pair$Int_ByteArray"
}
]
}
]
}
}
}
What Git revision are you using?
aiken v1.0.29-alpha+16fb02e
What operating system are you using, and which version?
Describe what the problem is?
Given the following Aiken code
the following definition in
plutus.json
gets createdHowever, there is no definition entry for
#/definitions/Pair$Int_ByteArray
createdNote that this bug doesn't exist for
List
types orTuple
types. A properList
entry gets created. This issue seems to only affectPair
, and is probably because Pair is not mentioned in CIP57What should be the expected behavior?
Either generate an entry for
Pair
, or change the schema to something else