RuntimeTransaction: Minor Cleanup (#34112)
This commit is contained in:
parent
7e3b09defe
commit
e589c07fef
|
@ -1,14 +1,14 @@
|
|||
/// RuntimeTransaction is `runtime` facing representation of transaction, while
|
||||
/// solana_sdk::SanitizedTransaction is client facing representation.
|
||||
///
|
||||
/// It has two states:
|
||||
/// 1. Statically Loaded: after receiving `packet` from sigverify and deserializing
|
||||
/// it into `solana_sdk::VersionedTransaction`, then sanitizing into
|
||||
/// `solana_sdk::SanitizedVersionedTransaction`, `RuntimeTransactionStatic`
|
||||
/// can be created from it with static transaction metadata extracted.
|
||||
/// 2. Dynamically Loaded: after successfully loaded account addresses from onchain
|
||||
/// ALT, RuntimeTransaction transits into Dynamically Loaded state, with
|
||||
/// its dynamic metadata loaded.
|
||||
//! RuntimeTransaction is `runtime` facing representation of transaction, while
|
||||
//! solana_sdk::SanitizedTransaction is client facing representation.
|
||||
//!
|
||||
//! It has two states:
|
||||
//! 1. Statically Loaded: after receiving `packet` from sigverify and deserializing
|
||||
//! it into `solana_sdk::VersionedTransaction`, then sanitizing into
|
||||
//! `solana_sdk::SanitizedVersionedTransaction`, `RuntimeTransactionStatic`
|
||||
//! can be created from it with static transaction metadata extracted.
|
||||
//! 2. Dynamically Loaded: after successfully loaded account addresses from onchain
|
||||
//! ALT, RuntimeTransaction transits into Dynamically Loaded state, with
|
||||
//! its dynamic metadata loaded.
|
||||
use {
|
||||
crate::transaction_meta::{DynamicMeta, StaticMeta, TransactionMeta},
|
||||
solana_sdk::{
|
||||
|
@ -22,12 +22,8 @@ use {
|
|||
|
||||
#[derive(Debug, Clone, Eq, PartialEq)]
|
||||
pub struct RuntimeTransactionStatic {
|
||||
// sanitized signatures
|
||||
signatures: Vec<Signature>,
|
||||
|
||||
// sanitized message
|
||||
message: SanitizedVersionedMessage,
|
||||
|
||||
// transaction meta is a collection of fields, it is updated
|
||||
// during message state transition
|
||||
meta: TransactionMeta,
|
||||
|
@ -70,12 +66,8 @@ impl RuntimeTransactionStatic {
|
|||
/// address_loader, to load accounts from on-chain ALT, then resolve dynamic metadata
|
||||
#[derive(Debug, Clone, Eq, PartialEq)]
|
||||
pub struct RuntimeTransactionDynamic {
|
||||
// sanitized signatures
|
||||
signatures: Vec<Signature>,
|
||||
|
||||
// sanitized message
|
||||
message: SanitizedMessage,
|
||||
|
||||
// transaction meta is a collection of fields, it is updated
|
||||
// during message state transition
|
||||
meta: TransactionMeta,
|
||||
|
@ -110,7 +102,6 @@ impl RuntimeTransactionDynamic {
|
|||
Ok(tx)
|
||||
}
|
||||
|
||||
// private helpers
|
||||
fn load_dynamic_metadata(&mut self) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
@ -34,11 +34,11 @@ pub struct TransactionMeta {
|
|||
}
|
||||
|
||||
impl TransactionMeta {
|
||||
pub fn set_message_hash(&mut self, message_hash: Hash) {
|
||||
pub(crate) fn set_message_hash(&mut self, message_hash: Hash) {
|
||||
self.message_hash = message_hash;
|
||||
}
|
||||
|
||||
pub fn set_is_simple_vote_tx(&mut self, is_simple_vote_tx: bool) {
|
||||
pub(crate) fn set_is_simple_vote_tx(&mut self, is_simple_vote_tx: bool) {
|
||||
self.is_simple_vote_tx = is_simple_vote_tx;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue