-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add more specific err message for invalid struct #164
Conversation
updated features
added break
Hello @cryptopapi997 , thanks for the PR , we will have a look and get back to you later :) |
crates/client/src/idl.rs
Outdated
@@ -545,7 +547,9 @@ pub fn parse_to_idl_program(name: String, code: &str) -> Result<IdlProgram, Erro | |||
}; | |||
Some(fields.into_iter()) | |||
}) | |||
.ok_or(Error::MissingOrInvalidProgramItems("instruction struct"))?; | |||
.ok_or(Error::MissingOrInvalidProgramItems( | |||
"instruction struct".to_string(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about also including the "instruction_struct_name" here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! Just added it
Adapted according to your review, feel free to take another look @lukacan |
Hi @cryptopapi997, thank you, it looks good to me! We might however reconsider this branching strategy in the (short) future in order to make contributions easier... |
Got it, just rebased & resolved merge conflicts - feel free to take a final look @Ikrk |
Thanks, merged! |
* Update README.md updated features * 📝 update urls in readme * 📌 bump crate versions * Update README.md added break * 🚑️ update docs before release * 📝 fix discord link * 📝 (add mike): Add mike * add more specific err message * add missing name on instruction struct too * Update index.md * Update index.md * rm main.html --------- Co-authored-by: Adam Hrazdira <[email protected]> Co-authored-by: Emre Ekinci <[email protected]> Co-authored-by: lukacan <[email protected]>
* Update README.md updated features * 📝 update urls in readme * 📌 bump crate versions * Update README.md added break * 🚑️ update docs before release * 📝 fix discord link * 📝 (add mike): Add mike * add more specific err message * add missing name on instruction struct too * Update index.md * Update index.md * rm main.html --------- Co-authored-by: Adam Hrazdira <[email protected]> Co-authored-by: Emre Ekinci <[email protected]> Co-authored-by: lukacan <[email protected]>
Follow up from #160 , where the issue was camel -> kebab -> camel case conversion isn't always constant. This was hard to determine since trident didn't say which struct was the problem. Saying which one it was (and seeing that it sees it incorrectly capitalized) would've made this easy to debug, so this PR changes this.
Maybe trident not supporting vars with multiple sequential capital letters could be specified in the docs somewhere too, but wasn't sure where the best spot for this is, so up to you guys.