[feat]: Support for non-uniform Data Enums
ngundotra opened this issue · 3 comments
ngundotra commented
Right now, Solita is unable to handle IDL types that have the following structure:
{
"name": "VoteThreshold",
"type": {
"kind": "enum",
"variants": [
{
"name": "YesVotePercentage",
"fields": [
"u8"
]
},
{
"name": "QuorumPercentage",
"fields": [
"u8"
]
},
{
"name": "Disabled"
}
]
}
}
Would be helpful for automatically maintaining SDKs like for SPL Governance.
ngundotra commented
Even Anchor doesn't have support for this: https://github.com/coral-xyz/anchor/blob/698426033052781988cd7980249726501ae08bdc/ts/src/coder/borsh/idl.ts#L126-L142
thlorenz commented
Could you have another go? I think #72 might have fixed this as well.
This now handles mixed enums i.e. with data and scalar variants.
ngundotra commented
Yes this is done! Thank you Thorsten :)