Skip to content

Commit

Permalink
remove solana-sdk from svm-transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinheavey committed Dec 2, 2024
1 parent 3b6ec80 commit be53376
Show file tree
Hide file tree
Showing 12 changed files with 57 additions and 25 deletions.
9 changes: 8 additions & 1 deletion Cargo.lock

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

7 changes: 6 additions & 1 deletion programs/sbf/Cargo.lock

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

11 changes: 10 additions & 1 deletion svm-transaction/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,13 @@ license = { workspace = true }
edition = { workspace = true }

[dependencies]
solana-sdk = { workspace = true }
solana-hash = { workspace = true }
solana-program = { workspace = true, default-features = false }
solana-pubkey = { workspace = true }
solana-sdk-ids = { workspace = true }
solana-signature = { workspace = true }
solana-transaction = { workspace = true }

[dev-dependencies]
solana-nonce = { workspace = true }
static_assertions = { workspace = true }
2 changes: 1 addition & 1 deletion svm-transaction/src/instruction.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use solana_sdk::instruction::CompiledInstruction;
use solana_program::instruction::CompiledInstruction;

/// A non-owning version of [`CompiledInstruction`] that references
/// slices of account indexes and data.
Expand Down
2 changes: 1 addition & 1 deletion svm-transaction/src/message_address_table_lookup.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use solana_sdk::{message::v0, pubkey::Pubkey};
use {solana_program::message::v0, solana_pubkey::Pubkey};

/// A non-owning version of [`v0::MessageAddressTableLookup`].
/// This simply references the data in the original message.
Expand Down
15 changes: 11 additions & 4 deletions svm-transaction/src/svm_message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,21 @@ use {
instruction::SVMInstruction, message_address_table_lookup::SVMMessageAddressTableLookup,
},
core::fmt::Debug,
solana_sdk::{
hash::Hash, message::AccountKeys, nonce::NONCED_TX_MARKER_IX_INDEX, pubkey::Pubkey,
system_program,
},
solana_hash::Hash,
solana_program::message::AccountKeys,
solana_pubkey::Pubkey,
solana_sdk_ids::system_program,
};

mod sanitized_message;
mod sanitized_transaction;
// inlined to avoid solana-nonce dep
#[cfg(test)]
static_assertions::const_assert_eq!(
NONCED_TX_MARKER_IX_INDEX,
solana_nonce::NONCED_TX_MARKER_IX_INDEX
);
const NONCED_TX_MARKER_IX_INDEX: u8 = 0;

// - Debug to support legacy logging
pub trait SVMMessage: Debug {
Expand Down
8 changes: 3 additions & 5 deletions svm-transaction/src/svm_message/sanitized_message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ use {
instruction::SVMInstruction, message_address_table_lookup::SVMMessageAddressTableLookup,
svm_message::SVMMessage,
},
solana_sdk::{
hash::Hash,
message::{AccountKeys, SanitizedMessage},
pubkey::Pubkey,
},
solana_hash::Hash,
solana_program::message::{AccountKeys, SanitizedMessage},
solana_pubkey::Pubkey,
};

// Implement for the "reference" `SanitizedMessage` type.
Expand Down
7 changes: 4 additions & 3 deletions svm-transaction/src/svm_message/sanitized_transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ use {
instruction::SVMInstruction, message_address_table_lookup::SVMMessageAddressTableLookup,
svm_message::SVMMessage,
},
solana_sdk::{
hash::Hash, message::AccountKeys, pubkey::Pubkey, transaction::SanitizedTransaction,
},
solana_hash::Hash,
solana_program::message::AccountKeys,
solana_pubkey::Pubkey,
solana_transaction::sanitized::SanitizedTransaction,
};

impl SVMMessage for SanitizedTransaction {
Expand Down
2 changes: 1 addition & 1 deletion svm-transaction/src/svm_transaction.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use {crate::svm_message::SVMMessage, solana_sdk::signature::Signature};
use {crate::svm_message::SVMMessage, solana_signature::Signature};

mod sanitized_transaction;

Expand Down
4 changes: 2 additions & 2 deletions svm-transaction/src/svm_transaction/sanitized_transaction.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use {
crate::svm_transaction::SVMTransaction,
solana_sdk::{signature::Signature, transaction::SanitizedTransaction},
crate::svm_transaction::SVMTransaction, solana_signature::Signature,
solana_transaction::sanitized::SanitizedTransaction,
};

impl SVMTransaction for SanitizedTransaction {
Expand Down
8 changes: 4 additions & 4 deletions svm-transaction/src/tests.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#![cfg(test)]
use {
crate::svm_message::SVMMessage,
solana_sdk::{
hash::Hash,
solana_hash::Hash,
solana_program::{
instruction::CompiledInstruction,
message::{
legacy,
v0::{self, LoadedAddresses, MessageAddressTableLookup},
MessageHeader, SanitizedMessage, SanitizedVersionedMessage, SimpleAddressLoader,
VersionedMessage,
},
pubkey::Pubkey,
system_instruction::SystemInstruction,
system_program,
},
solana_pubkey::Pubkey,
solana_sdk_ids::system_program,
std::collections::HashSet,
};

Expand Down
7 changes: 6 additions & 1 deletion 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 be53376

Please sign in to comment.