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

Lang: feature flag init if needed #1258

Merged

Conversation

paul-schaaf
Copy link
Contributor

@paul-schaaf paul-schaaf commented Jan 7, 2022

closes #1191

@armaniferrante
Copy link
Member

armaniferrante commented Jan 7, 2022

Blocked by #1199, since I promised we'd do a v0.20.1 release :).

@armaniferrante armaniferrante marked this pull request as ready for review January 10, 2022 03:54
@paul-schaaf
Copy link
Contributor Author

@armaniferrante any idea what might be causing the test to fail? Im not able to reproduce it locally.

@paul-schaaf paul-schaaf merged commit 17c9463 into coral-xyz:master Jan 30, 2022
losman0s pushed a commit to losman0s/anchor that referenced this pull request Feb 7, 2022
Co-authored-by: Armani Ferrante <armaniferrante@gmail.com>
@ceciEstErmat
Copy link
Contributor

I use it to initialize escrows of mints "on demand". Let's say a user wants to escrow mint X if it is the first one to do so then it will create the program escrow token account for this mint else it would just use the token account.

I found that feature pretty handy ! Even tho is forces us to always pass the system programs and token program and mint account 🤔

@paul-schaaf
Copy link
Contributor Author

you can still do that. The feature isnt gone. You just have to explicitly enable it

@arcticmatt
Copy link

maybe add some documentation about how to enable it on this PR?

@ceciEstErmat
Copy link
Contributor

@arcticmatt do something like this in your cargo

[dependencies]
anchor-lang = {version = "0.23.0", features = ["init-if-needed"]}

@arcticmatt
Copy link

@ceciEstErmat thanks! is that any different than doing this?

[features]
init-if-needed = []

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

lang: put init_if_needed behind feature flag
4 participants