pub trait FromTxCompact {
type TxType;
// Required method
fn from_tx_compact(
buf: &[u8],
tx_type: Self::TxType,
signature: Signature,
) -> (Self, &[u8])
where Self: Sized;
}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.
Required Associated Types§
Required Methods§
Sourcefn from_tx_compact(
buf: &[u8],
tx_type: Self::TxType,
signature: Signature,
) -> (Self, &[u8])where
Self: Sized,
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.
impl FromTxCompact for OpTxEnvelope
op only.