-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make idl enum fields which are snake case have proper typing to camel case #2378
Conversation
@nojob1 is attempting to deploy a commit to the coral-xyz Team on Vercel. A member of the Team first needs to authorize it. |
Looks great, would you mind to
For my own curiosity, just so that I can understand why this is broken but the struct stuff isn't broken, would you be able to share a link to where the same parsing is done correctly for |
for why the struct ones are fine I'm not 100% sure but I think it's just because the idl json generated for structs converts the fields to camelcase whereas the enum one does not. so they were parsing the idl basically the same (see https://github.com/coral-xyz/anchor/blob/master/ts/packages/anchor/src/coder/borsh/idl.ts#L121) but the idl itself was just different. in misc tests it doesn't even build for me because some errors which i guess fixing might be against your guys maintainer stuff but can just decide after. |
Here's the program for misc, you could try adding some custom types maybe? I don't think you need to go all the way to actually add them to an account or load data into them since this is just to test the IDL. program: https://github.com/coral-xyz/anchor/tree/master/tests/misc/programs/misc/src |
i think the test uses an idl that gets built (it's not committed) im fixing it so i can add. |
We want a test though in which the IDL gets built? Please don't commit the IDL itself. Also the test just failed because the ts code needs prettier run on it |
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
idk the issue i was having was that the program had a bunch of UncheckedAccount or similar without |
Ah right, you need to run with |
ah well, i guess not anymore seems tests worked |
Great, looks good to me. Thanks for the PR! |
closes: #2374 |
oh cool thanks. ohh i put my changelog in the comment not in the file lmao didn't know about that. Issue was just for the types not the actual object but i guess it's close enough. |
So what would be a more accurate changelog?
|
solves #2374
fixes:
ts: idl enum field types properly convert from snake case to camel case