Skip to content

Commit

Permalink
Extract system-transaction crate (#3834)
Browse files Browse the repository at this point in the history
* extract system-transaction crate

* remove solana-program and activate required feature

* fmt

* missing feature gating
  • Loading branch information
kevinheavey authored Dec 5, 2024
1 parent 3f38431 commit 3069e0c
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 9 deletions.
14 changes: 14 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 @@ -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",
Expand Down Expand Up @@ -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" }
Expand Down
14 changes: 14 additions & 0 deletions programs/sbf/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 sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
Expand Down Expand Up @@ -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",
Expand Down
7 changes: 6 additions & 1 deletion sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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")]
Expand Down
22 changes: 22 additions & 0 deletions sdk/system-transaction/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"] }
Original file line number Diff line number Diff line change
@@ -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
Expand Down
14 changes: 14 additions & 0 deletions svm/examples/Cargo.lock

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

0 comments on commit 3069e0c

Please sign in to comment.