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

Extract solana-account crate #2294

Merged
merged 16 commits into from
Oct 8, 2024
17 changes: 17 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ members = [
"runtime-transaction",
"sanitize",
"sdk",
"sdk/account",
"sdk/account-info",
"sdk/atomic-u64",
"sdk/cargo-build-sbf",
Expand Down Expand Up @@ -364,6 +365,7 @@ smallvec = "1.13.2"
smpl_jwt = "0.7.1"
socket2 = "0.5.7"
soketto = "0.7"
solana-account = { path = "sdk/account", version = "=2.1.0" }
solana-account-decoder = { path = "account-decoder", version = "=2.1.0" }
solana-account-info = { path = "sdk/account-info", version = "=2.1.0" }
solana-accounts-db = { path = "accounts-db", version = "=2.1.0" }
Expand Down
13 changes: 13 additions & 0 deletions programs/sbf/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ full = [
"digest",
]
borsh = ["dep:borsh", "solana-program/borsh", "solana-secp256k1-recover/borsh"]
dev-context-only-utils = ["qualifier_attr"]
dev-context-only-utils = ["qualifier_attr", "solana-account/dev-context-only-utils"]
frozen-abi = [
"dep:solana-frozen-abi",
"dep:solana-frozen-abi-macro",
"solana-feature-set/frozen-abi",
"solana-account/frozen-abi",
"solana-program/frozen-abi",
"solana-short-vec/frozen-abi",
"solana-signature/frozen-abi"
Expand Down Expand Up @@ -83,6 +84,7 @@ serde_with = { workspace = true, features = ["macros"] }
sha2 = { workspace = true }
sha3 = { workspace = true, optional = true }
siphasher = { workspace = true }
solana-account = { workspace = true, features = ["bincode"] }
solana-bn254 = { workspace = true }
solana-decode-error = { workspace = true }
solana-derivation-path = { workspace = true }
Expand Down
38 changes: 38 additions & 0 deletions sdk/account/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[package]
name = "solana-account"
description = "Solana Account type"
documentation = "https://docs.rs/solana-account"
version = { workspace = true }
authors = { workspace = true }
repository = { workspace = true }
homepage = { workspace = true }
license = { workspace = true }
edition = { workspace = true }

[dependencies]
bincode = { workspace = true, optional = true }
Copy link
Author

@kevinheavey kevinheavey Oct 3, 2024

Choose a reason for hiding this comment

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

Making serde and bincode optional won't remove those dependencies for now as solana-program still pulls them in, but by feature gating them from the start we avoid any breaking changes. In a later PR we'll remove the solana-program dep from this new crate

qualifier_attr = { workspace = true, optional = true }
serde = { workspace = true, optional = true }
serde_bytes = { workspace = true, optional = true }
serde_derive = { workspace = true, optional = true }
solana-frozen-abi = { workspace = true, optional = true }
solana-frozen-abi-macro = { workspace = true, optional = true }
solana-logger = { workspace = true, optional = true }
solana-program = { workspace = true }

[dev-dependencies]
solana-account = { path = ".", features = ["dev-context-only-utils"] }

[features]
bincode = ["dep:bincode", "serde"]
dev-context-only-utils = ["bincode", "dep:qualifier_attr"]
frozen-abi = [
"dep:solana-frozen-abi",
"dep:solana-frozen-abi-macro",
"dep:solana-logger",
"solana-program/frozen-abi",
]
serde = ["dep:serde", "dep:serde_bytes", "dep:serde_derive"]

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
Loading
Loading