solana-playground / solana-playground

Quickly develop, deploy and test Solana programs from browsers
https://beta.solpg.io
Apache License 2.0
398 stars 133 forks source link

Enum does not exist error #191

Open lostintime101 opened 3 months ago

lostintime101 commented 3 months ago

"Enum variant does not exist." error when the Enum does exist and the menu displays them.

There is also a small issue with the capitalization of the first character .e.g. the Enum menu first option appears as 'aDD' when it should be 'ADD'

https://github.com/solana-playground/solana-playground/assets/92709487/825e2d05-cfab-47f6-8db3-e1b76475b4b8

33d

Code Program IDL 444

acheroncrypto commented 3 months ago

Rust convention is to use PascalCase for enum variants so the UI does PascalCase to camelCase conversion to make it work with Anchor but your variants here are UPPERCASE so the case conversion is incorrect. We can fix this from playground side to not assume PascalCase variants but in the meantime, you can also fix this by converting your enum variants to PascalCase.

lostintime101 commented 3 months ago

Nice. Can confirm Pascal case fixes this (see pic)

cfsdfd