Skip to content
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

Closed
wants to merge 6 commits into from

Conversation

valentinmadrid
Copy link

Fixes #2434 for Token 2022 ATA constraints by using get_associated_token_address_with_program_id.

@vercel
Copy link

vercel bot commented Mar 28, 2023

@valentinmadrid is attempting to deploy a commit to the coral-xyz Team on Vercel.

A member of the Team first needs to authorize it.

@armaniferrante
Copy link
Member

Thank you! Can you add a test case for this?

@valentinmadrid
Copy link
Author

Thank you! Can you add a test case for this?

Added it to the Token Proxy Tests, hope that's ok.

Copy link
Collaborator

@acheroncrypto acheroncrypto left a 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.

lang/syn/src/codegen/accounts/constraints.rs Outdated Show resolved Hide resolved
lang/syn/src/codegen/accounts/constraints.rs Outdated Show resolved Hide resolved
@@ -170,7 +170,7 @@ pub struct ProxyCreateAssociatedTokenAccount<'info> {
#[account(mut)]
pub authority: Signer<'info>,
#[account(
init,
init_if_needed,
Copy link
Collaborator

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.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

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.

valentinmadrid and others added 2 commits April 5, 2023 16:45
Co-authored-by: acheron <98934430+acheroncrypto@users.noreply.github.com>
Co-authored-by: acheron <98934430+acheroncrypto@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing Token-2022 program supports on associated_token constraint
3 participants