Skip to main content

ConvertTx

Trait ConvertTx 

Source
pub trait ConvertTx<RawTx>:
    Send
    + Sync
    + 'static {
    type Tx;
    type Error;

    // Required method
    fn convert(&self, raw: RawTx) -> Result<Self::Tx, Self::Error>;
}
Available on crate feature node-api only.
Expand description

Converts a raw transaction into an executable transaction.

This trait abstracts the conversion logic (e.g., decoding, signature recovery) that is parallelized in the engine.

Required Associated Types§

Source

type Tx

The executable transaction type.

Source

type Error

Errors that may occur during conversion.

Required Methods§

Source

fn convert(&self, raw: RawTx) -> Result<Self::Tx, Self::Error>

Converts a raw transaction.

Implementors§

Source§

impl<A, B, RA, RB> ConvertTx<Either<RA, RB>> for Either<A, B>
where A: ConvertTx<RA>, B: ConvertTx<RB>,

Source§

type Tx = Either<<A as ConvertTx<RA>>::Tx, <B as ConvertTx<RB>>::Tx>

Source§

type Error = Either<<A as ConvertTx<RA>>::Error, <B as ConvertTx<RB>>::Error>

Source§

impl<F, RawTx, Tx, Err> ConvertTx<RawTx> for F
where F: Fn(RawTx) -> Result<Tx, Err> + Send + Sync + 'static,

Source§

type Tx = Tx

Source§

type Error = Err