Struct solana_sdk::transaction::SanitizedTransaction
source · [−]pub struct SanitizedTransaction { /* private fields */ }
Expand description
Sanitized transaction and the hash of its message
Implementations
sourceimpl SanitizedTransaction
impl SanitizedTransaction
sourcepub fn try_new(
tx: SanitizedVersionedTransaction,
message_hash: Hash,
is_simple_vote_tx: bool,
address_loader: impl AddressLoader
) -> Result<Self>
pub fn try_new(
tx: SanitizedVersionedTransaction,
message_hash: Hash,
is_simple_vote_tx: bool,
address_loader: impl AddressLoader
) -> Result<Self>
Create a sanitized transaction from a sanitized versioned transaction. If the input transaction uses address tables, attempt to lookup the address for each table index.
sourcepub fn try_create(
tx: VersionedTransaction,
message_hash: impl Into<MessageHash>,
is_simple_vote_tx: Option<bool>,
address_loader: impl AddressLoader,
require_static_program_ids: bool
) -> Result<Self>
pub fn try_create(
tx: VersionedTransaction,
message_hash: impl Into<MessageHash>,
is_simple_vote_tx: Option<bool>,
address_loader: impl AddressLoader,
require_static_program_ids: bool
) -> Result<Self>
Create a sanitized transaction from an un-sanitized versioned transaction. If the input transaction uses address tables, attempt to lookup the address for each table index.
pub fn try_from_legacy_transaction(tx: Transaction) -> Result<Self>
sourcepub fn from_transaction_for_tests(tx: Transaction) -> Self
pub fn from_transaction_for_tests(tx: Transaction) -> Self
Create a sanitized transaction from a legacy transaction. Used for tests only.
sourcepub fn signature(&self) -> &Signature
pub fn signature(&self) -> &Signature
Return the first signature for this transaction.
Notes:
Sanitized transactions must have at least one signature because the
number of signatures must be greater than or equal to the message header
value num_required_signatures
which must be greater than 0 itself.
sourcepub fn signatures(&self) -> &[Signature]
pub fn signatures(&self) -> &[Signature]
Return the list of signatures for this transaction
sourcepub fn message(&self) -> &SanitizedMessage
pub fn message(&self) -> &SanitizedMessage
Return the signed message
sourcepub fn message_hash(&self) -> &Hash
pub fn message_hash(&self) -> &Hash
Return the hash of the signed message
sourcepub fn is_simple_vote_transaction(&self) -> bool
pub fn is_simple_vote_transaction(&self) -> bool
Returns true if this transaction is a simple vote
sourcepub fn to_versioned_transaction(&self) -> VersionedTransaction
pub fn to_versioned_transaction(&self) -> VersionedTransaction
Convert this sanitized transaction into a versioned transaction for recording in the ledger.
sourcepub fn get_account_locks(&self) -> Result<TransactionAccountLocks<'_>>
pub fn get_account_locks(&self) -> Result<TransactionAccountLocks<'_>>
Validate and return the account keys locked by this transaction
sourcepub fn get_account_locks_unchecked(&self) -> TransactionAccountLocks<'_>
pub fn get_account_locks_unchecked(&self) -> TransactionAccountLocks<'_>
Return the list of accounts that must be locked during processing this transaction.
sourcepub fn get_loaded_addresses(&self) -> LoadedAddresses
pub fn get_loaded_addresses(&self) -> LoadedAddresses
Return the list of addresses loaded from on-chain address lookup tables
sourcepub fn get_durable_nonce(&self) -> Option<&Pubkey>
pub fn get_durable_nonce(&self) -> Option<&Pubkey>
If the transaction uses a durable nonce, return the pubkey of the nonce account
sourcepub fn verify_precompiles(&self, feature_set: &Arc<FeatureSet>) -> Result<()>
pub fn verify_precompiles(&self, feature_set: &Arc<FeatureSet>) -> Result<()>
Verify the precompiled programs in this transaction
Trait Implementations
sourceimpl Clone for SanitizedTransaction
impl Clone for SanitizedTransaction
sourcefn clone(&self) -> SanitizedTransaction
fn clone(&self) -> SanitizedTransaction
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl RefUnwindSafe for SanitizedTransaction
impl Send for SanitizedTransaction
impl Sync for SanitizedTransaction
impl Unpin for SanitizedTransaction
impl UnwindSafe for SanitizedTransaction
Blanket Implementations
sourceimpl<T> AbiExample for T
impl<T> AbiExample for T
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more