-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 Token 2022 ATA constraint #2447
Conversation
@valentinmadrid is attempting to deploy a commit to the coral-xyz Team on Vercel. A member of the Team first needs to authorize it. |
Thank you! Can you add a test case for this? |
Added it to the Token Proxy Tests, hope that's ok. |
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.
Thank you for the fix! Please check review comments.
@@ -170,7 +170,7 @@ pub struct ProxyCreateAssociatedTokenAccount<'info> { | |||
#[account(mut)] | |||
pub authority: Signer<'info>, | |||
#[account( | |||
init, | |||
init_if_needed, |
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.
It would be much better if you could add instructions and test cases that failed before your changes(cases in #2434) but now is successful instead of changing an existing test.
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.
Fyi, similar tests can be found at:
Associated token constraints - https://github.com/coral-xyz/anchor/blob/master/tests/misc/tests/misc/misc.ts#L904
init_if_needed
- https://github.com/coral-xyz/anchor/blob/master/tests/misc/tests/misc/misc.ts#L1549
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 Acheron, I'll jump back to this pr as soon as I can and add the specific tests.
Co-authored-by: acheron <98934430+acheroncrypto@users.noreply.github.com>
Co-authored-by: acheron <98934430+acheroncrypto@users.noreply.github.com>
Fixes #2434 for Token 2022 ATA constraints by using get_associated_token_address_with_program_id.