-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
fix: Fix optional accounts in declare_program!
#2967
fix: Fix optional accounts in declare_program!
#2967
Conversation
@cryptopapi997 is attempting to deploy a commit to the coral-xyz Team on Vercel. A member of the Team first needs to authorize it. |
Const generics
Fix bytes conversion
wdyt @acheroncrypto |
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.
wdyt @acheroncrypto
Small comment, looks great otherwise.
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.
Thanks for the fix!
Thanks for merging! Do you already have an ETA for the next patch release that will include these? |
ETA is early next month, but you can already use it from [dependencies]
anchor-lang = { git = "https://github.com/coral-xyz/anchor", rev = "b76d1bf" } and in anchor_version = "0.30.0-b76d1bf" |
When using optional accounts with
declare_program!
the generated code results in the account being set tocrate::ID
when the account isNone
. This means we get two scenarios:crate::ID
is that of the calling program.crate::ID
isn't defined anywhere.Both of these are the wrong thing to happen, but the fix is easy - just pass in
super::__ID
instead, which is what this PR does.