Skip to main content

FromConsensusTx

Trait FromConsensusTx 

pub trait FromConsensusTx<T>: Sized {
    type TxInfo;
    type Err: Error;

    // Required method
    fn from_consensus_tx(
        tx: T,
        signer: Address,
        tx_info: Self::TxInfo,
    ) -> Result<Self, Self::Err>;
}
Available on crate feature node-api only.
Expand description

Converts T into self.

Should create an RPC transaction response object based on a consensus transaction, its signer Address and an additional context FromConsensusTx::TxInfo.

Required Associated Types§

type TxInfo

An additional context, usually TransactionInfo in a wrapper that carries some implementation specific extra information.

type Err: Error

An associated RPC conversion error.

Required Methods§

fn from_consensus_tx( tx: T, signer: Address, tx_info: Self::TxInfo, ) -> Result<Self, Self::Err>

Performs the conversion consuming tx with signer and tx_info. See FromConsensusTx for details.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

§

impl<TxIn, T> FromConsensusTx<TxIn> for Transaction<T>
where TxIn: Transaction, T: Transaction + From<TxIn>,