-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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, ts: Add deprecated state address feature flag #446
Conversation
Updating [package]
name = "vault"
version = "0.1.0"
description = "Created with Anchor"
edition = "2018"
[lib]
crate-type = ["cdylib", "lib"]
name = "vault"
[features]
no-entrypoint = []
no-idl = []
cpi = ["no-entrypoint"]
anchor-deprecated-state = []
default = ["anchor-deprecated-state"]
[dependencies]
anchor-lang = { git = "https://github.com/project-serum/anchor", rev="76ff61ebcdcb8b6d9f81092f7a8786fca195dd66", features = ["anchor-deprecated-state"]}
anchor-spl = { git = "https://github.com/project-serum/anchor", rev="76ff61ebcdcb8b6d9f81092f7a8786fca195dd66", features = ["anchor-deprecated-state"] }
spl-token = "3.1.1"
spl-associated-token-account = {version = "1.0.2", features = ["no-entrypoint"]}
serum_dex = { git = "https://github.com/bonedaddy/serum-dex", rev="ceb2b2120ad1dbf03375f464ab65ade6fc18fa20", features = ["no-entrypoint"] }
bytemuck = { version = "1.4.0" }
[dev-dependencies]
rand = "0.7.3"
safe-transmute = "0.11.0"
bumpalo = { version = "3.4.0", features = ["collections"] } results in this error
however the following works [package]
name = "vault"
version = "0.1.0"
description = "Created with Anchor"
edition = "2018"
[lib]
crate-type = ["cdylib", "lib"]
name = "vault"
[features]
no-entrypoint = []
no-idl = []
cpi = ["no-entrypoint"]
anchor-deprecated-state = []
default = ["anchor-deprecated-state"]
[dependencies]
anchor-lang = { git = "https://github.com/project-serum/anchor", rev="76ff61ebcdcb8b6d9f81092f7a8786fca195dd66"}
anchor-spl = { git = "https://github.com/project-serum/anchor", rev="76ff61ebcdcb8b6d9f81092f7a8786fca195dd66"}
spl-token = "3.1.1"
spl-associated-token-account = {version = "1.0.2", features = ["no-entrypoint"]}
serum_dex = { git = "https://github.com/bonedaddy/serum-dex", rev="ceb2b2120ad1dbf03375f464ab65ade6fc18fa20", features = ["no-entrypoint"] }
bytemuck = { version = "1.4.0" }
[dev-dependencies]
rand = "0.7.3"
safe-transmute = "0.11.0"
bumpalo = { version = "3.4.0", features = ["collections"] } |
@bonedaddy correct the feature only needs to be in your program. Let me explore adding it to the anchor-lang dependency instead. |
I've moved the feature flag so that one must set it on the One important caveat when using this is that, if one's program depends on/links against any other anchor programs, they must all use this feature due to the fact that rust features are additive (so if one program enables the feature in anchor-lang, then it will be enabled for all transitive dependencies that also use anchor-lang). |
Thanks! Will try this tonight |
I have
and am getting a typescript compilation error from the following
|
|
Edit. You dont need feature flags for On second thought, I think the first commit given here is probably the most clear solution. I.e., forcing one to use the feature on their program, instead of on |
0c8aa4a
to
43954a5
Compare
Updated so that all one needs to do is add a default feature flag to their program to enable the change. This makes the behavior explicit and and allows one to mix and match programs that use this feature with programs that don't. This shouldn't be required in any other dependencies except for the javascript client. |
43954a5
to
2e703d3
Compare
Everything looks good, still having troubles with the ts dependency though. Here's my
Here's the error
|
I'm not sure. Try wiping your node modules and re-installing? |
Looks like im running into issues pinning the dependency to git as the typescript and javascript client code is in a subfolder which doesnt appear to be supported by npm/yarn via gfit deps |
Closes #445.