stellar_xdr/curr/
transaction_conversions.rs

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
use super::{
    FeeBumpTransaction, FeeBumpTransactionEnvelope, Transaction, TransactionEnvelope,
    TransactionV1Envelope, VecM,
};

impl From<Transaction> for TransactionEnvelope {
    fn from(tx: Transaction) -> Self {
        TransactionEnvelope::Tx(TransactionV1Envelope {
            tx,
            signatures: VecM::default(),
        })
    }
}

impl From<FeeBumpTransaction> for TransactionEnvelope {
    fn from(tx: FeeBumpTransaction) -> Self {
        TransactionEnvelope::TxFeeBump(FeeBumpTransactionEnvelope {
            tx,
            signatures: VecM::default(),
        })
    }
}

impl From<&FeeBumpTransaction> for TransactionEnvelope {
    fn from(tx: &FeeBumpTransaction) -> Self {
        tx.clone().into()
    }
}

impl From<&Transaction> for TransactionEnvelope {
    fn from(tx: &Transaction) -> Self {
        tx.clone().into()
    }
}