Skip to content

Commit

Permalink
move account_utils to account crate (#3174)
Browse files Browse the repository at this point in the history
* move account_utils to account crate

* remove superfluous import
  • Loading branch information
kevinheavey authored Oct 15, 2024
1 parent 598f7ae commit 1740ea2
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 5 deletions.
2 changes: 2 additions & 0 deletions 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 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/account/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@ 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-instruction = { workspace = true, optional = true }
solana-logger = { workspace = true, optional = true }
solana-program = { workspace = true }

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

[features]
bincode = ["dep:bincode", "serde"]
bincode = ["dep:bincode", "dep:solana-instruction", "serde"]
dev-context-only-utils = ["bincode", "dep:qualifier_attr"]
frozen-abi = [
"dep:solana-frozen-abi",
Expand Down
2 changes: 2 additions & 0 deletions sdk/account/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ use {
sync::Arc,
},
};
#[cfg(feature = "bincode")]
pub mod state_traits;

/// An Account with data that is stored on chain
#[repr(C)]
Expand Down
6 changes: 3 additions & 3 deletions sdk/src/account_utils.rs → sdk/account/src/state_traits.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//! Useful extras for `Account` state.
use {
crate::instruction::InstructionError,
crate::{Account, AccountSharedData},
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_pubkey::Pubkey};

#[test]
fn test_account_state() {
Expand Down
6 changes: 5 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,11 @@ 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::state_traits` crate instead"
)]
pub use solana_account::state_traits 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

0 comments on commit 1740ea2

Please sign in to comment.