1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
use chrono::{DateTime, Utc};
use fuel_tx::Transaction;
use std::ops::Deref;
use std::sync::Arc;
pub type ArcTx = Arc<Transaction>;
#[derive(Debug, Clone)]
pub struct TxInfo {
    tx: ArcTx,
    submited_time: DateTime<Utc>,
}
impl TxInfo {
    pub fn new(tx: ArcTx) -> Self {
        Self {
            tx,
            submited_time: Utc::now(),
        }
    }
    pub fn tx(&self) -> &ArcTx {
        &self.tx
    }
    pub fn submited_time(&self) -> DateTime<Utc> {
        self.submited_time
    }
}
impl Deref for TxInfo {
    type Target = ArcTx;
    fn deref(&self) -> &Self::Target {
        &self.tx
    }
}