Trait FromTxCompact

Source
pub trait FromTxCompact {
    type TxType;

    // Required method
    fn from_tx_compact(
        buf: &[u8],
        tx_type: Self::TxType,
        signature: Signature,
    ) -> (Self, &[u8])
       where Self: Sized;
}
Available on crate feature test-utils only.
Expand description

A trait for deserializing transaction without type and signature using Compact encoding.

It is not a responsibility of this trait to extract transaction type and signature, but both are needed to create the value. While these values can come from anywhere, likely this will be a part of a deserialization scenario with a greater scope where these values are deserialized separately.

See FromTxCompact::from_tx_compact.

Required Associated Types§

Source

type TxType

The transaction type that represents the set of transactions.

Required Methods§

Source

fn from_tx_compact( buf: &[u8], tx_type: Self::TxType, signature: Signature, ) -> (Self, &[u8])
where Self: Sized,

Deserializes inner transaction using Compact encoding. The concrete type is determined by tx_type. The signature is added to create typed and signed transaction.

Returns a tuple of 2 elements. The first element is the deserialized value and the second is a byte slice created from buf with a starting position advanced by the exact amount of bytes consumed for this process.

Implementations on Foreign Types§

Source§

impl FromTxCompact for OpTxEnvelope

Available on crate feature op only.
Source§

type TxType = OpTxType

Source§

fn from_tx_compact( buf: &[u8], tx_type: OpTxType, signature: Signature, ) -> (Self, &[u8])

Source§

impl FromTxCompact for SeismicTxEnvelope

Source§

type TxType = SeismicTxType

Source§

fn from_tx_compact( buf: &[u8], tx_type: SeismicTxType, signature: Signature, ) -> (Self, &[u8])

Source§

impl<Eip4844: Compact + Transaction> FromTxCompact for EthereumTxEnvelope<Eip4844>

Source§

type TxType = TxType

Source§

fn from_tx_compact( buf: &[u8], tx_type: TxType, signature: Signature, ) -> (Self, &[u8])

Implementors§