Skip to content

Commit

Permalink
runtime-transaction no gate traits
Browse files Browse the repository at this point in the history
  • Loading branch information
apfitzge committed Sep 27, 2024
1 parent 5c9c5c7 commit b89e763
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions runtime-transaction/src/runtime_transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use {
simple_vote_transaction_checker::is_simple_vote_transaction,
transaction::{Result, SanitizedTransaction, SanitizedVersionedTransaction},
},
solana_svm_transaction::instruction::SVMInstruction,
solana_svm_transaction::{instruction::SVMInstruction, svm_message::SVMMessage},
std::collections::HashSet,
};

Expand All @@ -37,19 +37,7 @@ pub struct RuntimeTransaction<T> {
meta: TransactionMeta,
}

// These traits gate access to static and dynamic metadata
// so that only transactions with supporting message types
// can access them.
trait StaticMetaAccess {}
trait DynamicMetaAccess: StaticMetaAccess {}

// Implement the gate traits for the message types that should
// have access to the static and dynamic metadata.
impl StaticMetaAccess for SanitizedVersionedTransaction {}
impl StaticMetaAccess for SanitizedTransaction {}
impl DynamicMetaAccess for SanitizedTransaction {}

impl<T: StaticMetaAccess> StaticMeta for RuntimeTransaction<T> {
impl<T> StaticMeta for RuntimeTransaction<T> {
fn message_hash(&self) -> &Hash {
&self.meta.message_hash
}
Expand All @@ -66,7 +54,7 @@ impl<T: StaticMetaAccess> StaticMeta for RuntimeTransaction<T> {
}
}

impl<T: DynamicMetaAccess> DynamicMeta for RuntimeTransaction<T> {}
impl<T: SVMMessage> DynamicMeta for RuntimeTransaction<T> {}

impl<T> Deref for RuntimeTransaction<T> {
type Target = T;
Expand Down

0 comments on commit b89e763

Please sign in to comment.