Closed SebastienGllmt closed 3 months ago
It isn't missing, it's actually part of the spec:
dataType
The value of this keyword must be a string, with one of the following value listed in the first column of the table above. This keyword is optional. When missing, the instance is implicitly typed as an opaque Plutus Data.
The rationale here being that Data
actually represent any possible value that can appear in a contract ABI. So it can be the default to anything. dataType
allows to constraint further down the type. But when unspecified, it simply is Data
.
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 createdThis type has no
dataType
as expected (sinceData
isn't a primitive in cip57`).What should be the expected behavior?
I'm not sure how this should be handled. From a
plutus.json
parsing tool, I can just hardcode `title === 'Data'), but maybe this should be mentioned in cip57? If Data is an Aiken-only type, then maybe there needs to be a way for CIP57 to be more clear on handling of custom compiler-specific typesThere is a precedent for handle this because of the
Void
type in Aiken which is a custom type represented asBut there are also other cases of custom types missing such as https://github.com/aiken-lang/aiken/issues/970