Skip to content

Commit

Permalink
Extract solana-account crate (#2294)
Browse files Browse the repository at this point in the history
* extract account crate

* tpyo in crate name

* update account usage in sdk

* update solana-program examples

* re-export solana_account with deprecation notice

* fix frozen-abi support

* fmt

* update digest

* update lock file

* fix doctests

* update lock file

* remove unnecessary build script

* update lock files

* sort table

* make serde and bincode optional in the new crate

* update digest
  • Loading branch information
kevinheavey authored Oct 8, 2024
1 parent a722d09 commit 01520c1
Show file tree
Hide file tree
Showing 15 changed files with 181 additions and 72 deletions.
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 }
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

0 comments on commit 01520c1

Please sign in to comment.