Skip to content

Lang: feature flag init if needed#1258

Merged
paul-schaaf merged 13 commits into
otter-sec:masterfrom
paul-schaaf:lang/feature-flag-init-if-needed
Jan 30, 2022
Merged

Lang: feature flag init if needed#1258
paul-schaaf merged 13 commits into
otter-sec:masterfrom
paul-schaaf:lang/feature-flag-init-if-needed

Conversation

@paul-schaaf

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

Copy link
Copy Markdown
Contributor

closes #1191

@armaniferrante

armaniferrante commented Jan 7, 2022

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor Author

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

Comment thread lang/syn/src/parser/accounts/constraints.rs Outdated
@paul-schaaf paul-schaaf merged commit 17c9463 into otter-sec: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
Copy Markdown
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
Copy Markdown
Contributor Author

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

@arcticmatt

Copy link
Copy Markdown

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

@ceciEstErmat

Copy link
Copy Markdown
Contributor

@arcticmatt do something like this in your cargo

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

@arcticmatt

Copy link
Copy Markdown

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

[features]
init-if-needed = []

Otter-0x4ka5h pushed a commit to Otter-0x4ka5h/anchor that referenced this pull request Mar 25, 2026
Co-authored-by: Armani Ferrante <armaniferrante@gmail.com>
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