You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AccountInfo can be used as a type but Unchecked Account should be used instead.
If my understanding is correct,
UncheckedAccount is unsafe, and is named appropriately for something that does not perform checks.
AccountInfo is unsafe, and has a name that doesn't indicate it should be avoided unless you know what you're doing (I'm aware the name comes from Solana itself not Anchor)
Ideally Anchor should have one name that's explicit for unchecked accounts. AccountInfo should throw up a warning or just be removed in the next breaking release.
This would also mean we don't have to bother explaining this to everyone learning Anchor (as some background, I'm currently reorienting the Solana Development Course to focus on Anchor as the preferred mechanism for Rust).
Thanks for listening! 😊
The text was updated successfully, but these errors were encountered:
Yes, your understanding is correct. Also, using UncheckedAccount is more performant than using AccountInfo. This is a reasonable request and in fact, I was already considering deprecating AccountInfo before the next release.
Per the anchor docs:
If my understanding is correct,
UncheckedAccount is unsafe, and is named appropriately for something that does not perform checks.
AccountInfo is unsafe, and has a name that doesn't indicate it should be avoided unless you know what you're doing (I'm aware the name comes from Solana itself not Anchor)
Ideally Anchor should have one name that's explicit for unchecked accounts. AccountInfo should throw up a warning or just be removed in the next breaking release.
This would also mean we don't have to bother explaining this to everyone learning Anchor (as some background, I'm currently reorienting the Solana Development Course to focus on Anchor as the preferred mechanism for Rust).
Thanks for listening! 😊
The text was updated successfully, but these errors were encountered: