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

remove solana-sdk from svm-transaction #3854

Merged
merged 2 commits into from
Dec 4, 2024
Merged
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
10 changes: 9 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.

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

[dependencies]
solana-sdk = { workspace = true }
solana-hash = { workspace = true }
solana-message = { workspace = true }
solana-pubkey = { workspace = true }
solana-sdk-ids = { workspace = true }
solana-signature = { workspace = true }
solana-transaction = { workspace = true }

[dev-dependencies]
solana-message = { workspace = true, features = ["bincode"] }
solana-nonce = { workspace = true }
solana-system-interface = { 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_message::compiled_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_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_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_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_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
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
22 changes: 10 additions & 12 deletions svm-transaction/src/tests.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
#![cfg(test)]
use {
crate::svm_message::SVMMessage,
solana_sdk::{
hash::Hash,
instruction::CompiledInstruction,
message::{
legacy,
v0::{self, LoadedAddresses, MessageAddressTableLookup},
MessageHeader, SanitizedMessage, SanitizedVersionedMessage, SimpleAddressLoader,
VersionedMessage,
},
pubkey::Pubkey,
system_instruction::SystemInstruction,
system_program,
solana_hash::Hash,
solana_message::{
compiled_instruction::CompiledInstruction,
legacy,
v0::{self, LoadedAddresses, MessageAddressTableLookup},
MessageHeader, SanitizedMessage, SanitizedVersionedMessage, SimpleAddressLoader,
VersionedMessage,
},
solana_pubkey::Pubkey,
solana_sdk_ids::system_program,
solana_system_interface::instruction::SystemInstruction,
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.

Loading