lssa/sequencer_core/src/transaction_mempool.rs

22 lines
547 B
Rust
Raw Normal View History

use common::{merkle_tree_public::TreeHashType, transaction::AuthenticatedTransaction};
2024-10-10 14:09:31 +03:00
use mempool::mempoolitem::MemPoolItem;
use serde::{Deserialize, Serialize};
pub struct MempoolTransaction {
pub tx: AuthenticatedTransaction,
2024-10-10 14:09:31 +03:00
}
impl From<AuthenticatedTransaction> for MempoolTransaction {
fn from(value: AuthenticatedTransaction) -> Self {
2025-04-16 16:17:53 +03:00
Self { tx: value }
}
}
impl MemPoolItem for MempoolTransaction {
type Identifier = TreeHashType;
2024-10-10 14:09:31 +03:00
fn identifier(&self) -> Self::Identifier {
*self.tx.hash()
2024-10-10 14:09:31 +03:00
}
}