use common::{merkle_tree_public::TreeHashType, transaction::AuthenticatedTransaction}; use mempool::mempoolitem::MemPoolItem; use serde::{Deserialize, Serialize}; pub struct MempoolTransaction { pub tx: AuthenticatedTransaction, } impl From for MempoolTransaction { fn from(value: AuthenticatedTransaction) -> Self { Self { tx: value } } } // impl Serialize for TransactionMempool { // fn serialize(&self, serializer: S) -> Result // where // S: serde::Serializer, // { // self.tx.serialize(serializer) // } // } // // impl<'de> Deserialize<'de> for TransactionMempool { // fn deserialize(deserializer: D) -> Result // where // D: serde::Deserializer<'de>, // { // match TransactionBody::deserialize(deserializer) { // Ok(tx) => Ok(TransactionMempool { tx }), // Err(err) => Err(err), // } // } // } impl MemPoolItem for MempoolTransaction { type Identifier = TreeHashType; fn identifier(&self) -> Self::Identifier { *self.tx.hash() } }