prelude.Option
docs: Incorrect constructors order?
#751
Answered
by
KtorZ
ariady-putra
asked this question in
Q&A
-
Hello, in the Prelude docs for But when building the datatype from offchain I needed to set const constrOption = {
some: (thing: any) => new Constr(0, [thing]),
none: new Constr(1, []),
};
const constrBool = {
f: new Constr(0, []),
t: new Constr(1, []),
}; for {
"title": "Optional",
"anyOf": [
{
"title": "Some",
"description": "An optional value.",
"dataType": "constructor",
"index": 0,
"fields": [{..}]
},
{
"title": "None",
"description": "Nothing.",
"dataType": "constructor",
"index": 1,
"fields": []
}
]
} {
"title": "Bool",
"anyOf": [
{
"title": "False",
"dataType": "constructor",
"index": 0,
"fields": []
},
{
"title": "True",
"dataType": "constructor",
"index": 1,
"fields": []
}
]
} EDIT: Updated for |
Beta Was this translation helpful? Give feedback.
Answered by
KtorZ
Oct 18, 2023
Replies: 1 comment
-
The doc is wrong, the blueprint is right. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
ariady-putra
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The doc is wrong, the blueprint is right.