-
Notifications
You must be signed in to change notification settings - Fork 254
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
onchain-development intro-to-anchor updated #349
Conversation
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.
This needs a little work but should be good to go once the items above are addressed.
-
There's a few places where the old language is just vague or unnecessarily long. We should fix this. I've marked them and provided suggestions, but there may be more. Please look at the original article and try to simplify it as much as possible, anywhere you can.
-
Read up on INIT_SPACE https://www.anchor-lang.com/docs/space#the-init-space-macro
Also for "Before we begin, install Anchor by" - just link to 'local-setup.md' file instead, see CONTRIBUTING.md on how to make links.
aye ! on it ! |
I've made the changes and also went through the article once more to find and simplify some parts. |
I did the editing for this one. Let me know if anything is left. |
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.
A few small suggestions to the old writing, plus some small tweaks - if you make them we can get this in today!
@@ -90,13 +105,20 @@ mod program_module_name { | |||
} |
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.
Formatting above looks odd, see CONTRIUBUTING.md
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.
I think it only appears like this in the diff window. I checked locally and on my github branch, its appears to be properly formatted there.
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.
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.
I bet it's using a mix of tabs and spaces, and your local branch probably has some value set for tabs (2 spaces, 4 spaces, 8 spaces) that differs from what github uses. So yes it's a prob - please do fix it!
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.
Can you show/tell me whats exactly out of place here, I didn't touch this part and it seems like it is formatted like everything Rust part in the file. Also used rustfmt
as instructed in CONTRIBUTING.md, nothing changes.
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.
Pardon the wait, we have a 24 person training course with new material then Rustconf then Breakpoint. See comments above.
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.
Use 'instruction handlers' for the function per below, and update
https://github.com/Unboxed-Software/anchor-counter-program/tree/solution-increment
https://github.com/Unboxed-Software/anchor-counter-program/tree/solution-decrement
To use https://github.com/solana-developers/anchor-counter-program
and we can merge this and you will win the lesson bounty.
`#[derive(Accounts)]`). This implements an `Accounts` deserializer on the given | ||
struct and removes the need to deserialize each account manually. | ||
- Defines a structure of validated accounts for an instruction | ||
- Makes accounts accessible through an instruction's `Context` |
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.
Can you please go through and fix usage of 'instruction handler' (for the function) versus 'instruction' (for the input to the function)? See CONTRIBUTING.md
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.
yes sure
So I have to correct the usage of instuction handler
and instruction
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.
did it
* onchain intro-to-onchain updated * some refactors * minor refactors * minor refactors * minor refactors * Delete content/courses/onchain-development/temp.rs * 'instruction handler' and 'instruction' terminology usage fixed --------- Co-authored-by: Mike MacCana <mike.maccana@gmail.com>
Summary of Changes
INIT_SPACE
practice for space calculation in anchor.