IDL: Remove NodeRef and NodeRefMut enums
Anchor cannot load idls that include enums with tuple variants.
This commit is contained in:
parent
7c4d052979
commit
46b6bce14b
|
@ -14,3 +14,8 @@ for pair_str in \
|
|||
perl -0777 -pi -e "s/\{\s*\"defined\":\s*\"${pair[0]}\"\s*\}/\"${pair[1]}\"/g" \
|
||||
target/idl/mango_v4.json target/types/mango_v4.ts;
|
||||
done
|
||||
|
||||
# Anchor puts all enums in the IDL, independent of visibility. And then it
|
||||
# errors on enums that have tuple variants. This hack drops these from the idl.
|
||||
perl -0777 -pi -e 's/ *{\s*"name": "NodeRef(?<nested>(?:[^{}[\]]+|\{(?&nested)\}|\[(?&nested)\])*)\},\n//g' \
|
||||
target/idl/mango_v4.json target/types/mango_v4.ts;
|
||||
|
|
|
@ -173,12 +173,12 @@ const_assert_eq!(size_of::<AnyNode>(), size_of::<InnerNode>());
|
|||
const_assert_eq!(size_of::<AnyNode>(), size_of::<LeafNode>());
|
||||
const_assert_eq!(size_of::<AnyNode>(), size_of::<FreeNode>());
|
||||
|
||||
pub enum NodeRef<'a> {
|
||||
pub(crate) enum NodeRef<'a> {
|
||||
Inner(&'a InnerNode),
|
||||
Leaf(&'a LeafNode),
|
||||
}
|
||||
|
||||
pub enum NodeRefMut<'a> {
|
||||
pub(crate) enum NodeRefMut<'a> {
|
||||
Inner(&'a mut InnerNode),
|
||||
Leaf(&'a mut LeafNode),
|
||||
}
|
||||
|
|
|
@ -4048,54 +4048,6 @@ export type MangoV4 = {
|
|||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "NodeRef",
|
||||
"type": {
|
||||
"kind": "enum",
|
||||
"variants": [
|
||||
{
|
||||
"name": "Inner",
|
||||
"fields": [
|
||||
{
|
||||
"defined": "&'aInnerNode"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Leaf",
|
||||
"fields": [
|
||||
{
|
||||
"defined": "&'aLeafNode"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "NodeRefMut",
|
||||
"type": {
|
||||
"kind": "enum",
|
||||
"variants": [
|
||||
{
|
||||
"name": "Inner",
|
||||
"fields": [
|
||||
{
|
||||
"defined": "&'amutInnerNode"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Leaf",
|
||||
"fields": [
|
||||
{
|
||||
"defined": "&'amutLeafNode"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "OrderType",
|
||||
"type": {
|
||||
|
@ -8795,54 +8747,6 @@ export const IDL: MangoV4 = {
|
|||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "NodeRef",
|
||||
"type": {
|
||||
"kind": "enum",
|
||||
"variants": [
|
||||
{
|
||||
"name": "Inner",
|
||||
"fields": [
|
||||
{
|
||||
"defined": "&'aInnerNode"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Leaf",
|
||||
"fields": [
|
||||
{
|
||||
"defined": "&'aLeafNode"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "NodeRefMut",
|
||||
"type": {
|
||||
"kind": "enum",
|
||||
"variants": [
|
||||
{
|
||||
"name": "Inner",
|
||||
"fields": [
|
||||
{
|
||||
"defined": "&'amutInnerNode"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Leaf",
|
||||
"fields": [
|
||||
{
|
||||
"defined": "&'amutLeafNode"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "OrderType",
|
||||
"type": {
|
||||
|
|
Loading…
Reference in New Issue