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 account-utils crate #3083

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 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 @@ -103,6 +103,7 @@ members = [
"sdk",
"sdk/account",
"sdk/account-info",
"sdk/account-utils",
"sdk/atomic-u64",
"sdk/cargo-build-sbf",
"sdk/cargo-test-sbf",
Expand Down Expand Up @@ -368,6 +369,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-account-utils = { path = "sdk/account-utils", version = "=2.1.0" }
solana-accounts-db = { path = "accounts-db", version = "=2.1.0" }
solana-address-lookup-table-program = { path = "programs/address-lookup-table", version = "=2.1.0" }
solana-atomic-u64 = { path = "sdk/atomic-u64", version = "=2.1.0" }
Expand Down
11 changes: 11 additions & 0 deletions programs/sbf/Cargo.lock

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

1 change: 1 addition & 0 deletions sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ sha2 = { workspace = true }
sha3 = { workspace = true, optional = true }
siphasher = { workspace = true }
solana-account = { workspace = true, features = ["bincode"] }
solana-account-utils = { workspace = true }
solana-bn254 = { workspace = true }
solana-decode-error = { workspace = true }
solana-derivation-path = { workspace = true }
Expand Down
22 changes: 22 additions & 0 deletions sdk/account-utils/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[package]
name = "solana-account-utils"
description = "Useful extras for Solana `Account` state."
documentation = "https://docs.rs/solana-account-utils"
version = { workspace = true }
authors = { workspace = true }
repository = { workspace = true }
homepage = { workspace = true }
license = { workspace = true }
edition = { workspace = true }

[dependencies]
bincode = { workspace = true }
serde = { workspace = true }
solana-account = { workspace = true, features = ["bincode"] }
solana-instruction = { workspace = true }

[dev-dependencies]
solana-pubkey = { workspace = true }

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
4 changes: 2 additions & 2 deletions sdk/src/account_utils.rs → sdk/account-utils/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//! Useful extras for `Account` state.

use {
crate::instruction::InstructionError,
bincode::ErrorKind,
solana_account::{Account, AccountSharedData},
solana_instruction::error::InstructionError,
std::cell::Ref,
};

Expand Down Expand Up @@ -64,7 +64,7 @@ where

#[cfg(test)]
mod tests {
use {super::*, crate::pubkey::Pubkey, solana_account::AccountSharedData};
use {super::*, solana_account::AccountSharedData, solana_pubkey::Pubkey};

#[test]
fn test_account_state() {
Expand Down
3 changes: 2 additions & 1 deletion sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ pub use solana_program::{
};
#[cfg(feature = "borsh")]
pub use solana_program::{borsh, borsh0_10, borsh1};
pub mod account_utils;
pub mod client;
pub mod commitment_config;
pub mod compute_budget;
Expand Down Expand Up @@ -108,6 +107,8 @@ pub mod wasm;

#[deprecated(since = "2.1.0", note = "Use `solana-account` crate instead")]
pub use solana_account as account;
#[deprecated(since = "2.1.0", note = "Use `solana-account-utils` crate instead")]
pub use solana_account_utils as account_utils;
#[deprecated(since = "2.1.0", note = "Use `solana-bn254` crate instead")]
pub use solana_bn254 as alt_bn128;
#[deprecated(since = "2.1.0", note = "Use `solana-decode-error` crate instead")]
Expand Down
Loading