hdp_primitives/processed_types/
transaction.rs

1//! The transaction module contains the ProcessedTransaction struct and its conversion to ProcessedTransactionInFelts.
2
3use crate::utils::tx_index_to_tx_key;
4use alloy::primitives::Bytes;
5use serde::{Deserialize, Serialize};
6
7#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Eq, Hash)]
8pub struct ProcessedTransaction {
9    pub key: String,
10    pub block_number: u64,
11    pub proof: Vec<Bytes>,
12}
13
14impl ProcessedTransaction {
15    pub fn new(index: u64, block_number: u64, proof: Vec<Bytes>) -> Self {
16        let key = tx_index_to_tx_key(index);
17        Self {
18            key,
19            block_number,
20            proof,
21        }
22    }
23}