diff --git a/Cargo.lock b/Cargo.lock index a95accb4393553..d4f9121908abe9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8561,6 +8561,7 @@ dependencies = [ "solana-short-vec", "solana-signature", "solana-signer", + "solana-system-transaction", "solana-sysvar", "solana-time-utils", "solana-transaction", @@ -9066,6 +9067,19 @@ dependencies = [ "solana-type-overrides", ] +[[package]] +name = "solana-system-transaction" +version = "2.2.0" +dependencies = [ + "solana-hash", + "solana-keypair", + "solana-message", + "solana-pubkey", + "solana-signer", + "solana-system-interface", + "solana-transaction", +] + [[package]] name = "solana-sysvar" version = "2.2.0" diff --git a/Cargo.toml b/Cargo.toml index c62c59226c78d2..4b772019b47900 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -173,6 +173,7 @@ members = [ "sdk/slot-hashes", "sdk/slot-history", "sdk/stable-layout", + "sdk/system-transaction", "sdk/sysvar", "sdk/sysvar-id", "sdk/time-utils", @@ -570,6 +571,7 @@ solana-svm-rent-collector = { path = "svm-rent-collector", version = "=2.2.0" } solana-svm-transaction = { path = "svm-transaction", version = "=2.2.0" } solana-system-interface = "1.0" solana-system-program = { path = "programs/system", version = "=2.2.0" } +solana-system-transaction = { path = "sdk/system-transaction", version = "=2.2.0" } solana-sysvar = { path = "sdk/sysvar", version = "=2.2.0" } solana-sysvar-id = { path = "sdk/sysvar-id", version = "=2.2.0" } solana-test-validator = { path = "test-validator", version = "=2.2.0" } diff --git a/programs/sbf/Cargo.lock b/programs/sbf/Cargo.lock index 304ee030d03b02..c7ce89f5001706 100644 --- a/programs/sbf/Cargo.lock +++ b/programs/sbf/Cargo.lock @@ -7256,6 +7256,7 @@ dependencies = [ "solana-short-vec", "solana-signature", "solana-signer", + "solana-system-transaction", "solana-time-utils", "solana-transaction", "solana-transaction-context", @@ -7637,6 +7638,19 @@ dependencies = [ "solana-type-overrides", ] +[[package]] +name = "solana-system-transaction" +version = "2.2.0" +dependencies = [ + "solana-hash", + "solana-keypair", + "solana-message", + "solana-pubkey", + "solana-signer", + "solana-system-interface", + "solana-transaction", +] + [[package]] name = "solana-sysvar" version = "2.2.0" diff --git a/sdk/Cargo.toml b/sdk/Cargo.toml index a704a315a420b8..2b42c3a884b3e2 100644 --- a/sdk/Cargo.toml +++ b/sdk/Cargo.toml @@ -47,6 +47,7 @@ full = [ "dep:solana-seed-derivable", "dep:solana-seed-phrase", "dep:solana-signer", + "dep:solana-system-transaction", "dep:solana-transaction", "dep:solana-transaction-error", ] @@ -175,6 +176,7 @@ solana-signature = { workspace = true, features = [ "verify", ], optional = true } solana-signer = { workspace = true, optional = true } +solana-system-transaction = { workspace = true, optional = true } solana-time-utils = { workspace = true } solana-transaction = { workspace = true, features = [ "blake3", diff --git a/sdk/src/lib.rs b/sdk/src/lib.rs index 752ad612a5c7b5..3076c997b251a5 100644 --- a/sdk/src/lib.rs +++ b/sdk/src/lib.rs @@ -95,7 +95,6 @@ pub mod rpc_port; pub mod shred_version; pub mod signature; pub mod signer; -pub mod system_transaction; pub mod transaction; pub mod transport; pub mod wasm; @@ -201,6 +200,12 @@ pub use solana_serde as deserialize_utils; pub use solana_serde_varint as serde_varint; #[deprecated(since = "2.1.0", note = "Use `solana-short-vec` crate instead")] pub use solana_short_vec as short_vec; +#[cfg(feature = "full")] +#[deprecated( + since = "2.2.0", + note = "Use `solana-system-transaction` crate instead" +)] +pub use solana_system_transaction as system_transaction; #[deprecated(since = "2.2.0", note = "Use `solana-time-utils` crate instead")] pub use solana_time_utils as timing; #[cfg(feature = "full")] diff --git a/sdk/system-transaction/Cargo.toml b/sdk/system-transaction/Cargo.toml new file mode 100644 index 00000000000000..1ef1875435c0b3 --- /dev/null +++ b/sdk/system-transaction/Cargo.toml @@ -0,0 +1,22 @@ +[package] +name = "solana-system-transaction" +description = "Functionality for creating system transactions." +documentation = "https://docs.rs/solana-system-transaction" +version = { workspace = true } +authors = { workspace = true } +repository = { workspace = true } +homepage = { workspace = true } +license = { workspace = true } +edition = { workspace = true } + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[dependencies] +solana-hash = { workspace = true } +solana-keypair = { workspace = true } +solana-message = { workspace = true } +solana-pubkey = { workspace = true } +solana-signer = { workspace = true } +solana-system-interface = { workspace = true, features = ["bincode"] } +solana-transaction = { workspace = true, features = ["bincode"] } diff --git a/sdk/src/system_transaction.rs b/sdk/system-transaction/src/lib.rs similarity index 92% rename from sdk/src/system_transaction.rs rename to sdk/system-transaction/src/lib.rs index 4de37dd56602db..850633e3b88fcb 100644 --- a/sdk/src/system_transaction.rs +++ b/sdk/system-transaction/src/lib.rs @@ -1,13 +1,9 @@ //! The `system_transaction` module provides functionality for creating system transactions. -#![cfg(feature = "full")] -use crate::{ - hash::Hash, - message::Message, - pubkey::Pubkey, - signature::{Keypair, Signer}, - system_instruction, - transaction::Transaction, +use { + solana_hash::Hash, solana_keypair::Keypair, solana_message::Message, solana_pubkey::Pubkey, + solana_signer::Signer, solana_system_interface::instruction as system_instruction, + solana_transaction::Transaction, }; /// Create and sign new SystemInstruction::CreateAccount transaction diff --git a/svm/examples/Cargo.lock b/svm/examples/Cargo.lock index e7e8a12ebf77fb..1cc9d6a4e80fa8 100644 --- a/svm/examples/Cargo.lock +++ b/svm/examples/Cargo.lock @@ -6584,6 +6584,7 @@ dependencies = [ "solana-short-vec", "solana-signature", "solana-signer", + "solana-system-transaction", "solana-time-utils", "solana-transaction", "solana-transaction-context", @@ -6982,6 +6983,19 @@ dependencies = [ "solana-type-overrides", ] +[[package]] +name = "solana-system-transaction" +version = "2.2.0" +dependencies = [ + "solana-hash", + "solana-keypair", + "solana-message", + "solana-pubkey", + "solana-signer", + "solana-system-interface", + "solana-transaction", +] + [[package]] name = "solana-sysvar" version = "2.2.0"