Skip to content

Commit

Permalink
runtime-transaction no gate traits (#2986)
Browse files Browse the repository at this point in the history
  • Loading branch information
apfitzge authored Sep 30, 2024
1 parent c728362 commit 0b44eb6
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions runtime-transaction/src/runtime_transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,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 @@ -70,7 +58,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 0b44eb6

Please sign in to comment.