[][src]Trait frame_system::offchain::SubmitSignedTransaction

pub trait SubmitSignedTransaction<T: Trait, Call> {
    type Extrinsic: ExtrinsicT<Call = Call> + Encode;
    type CreateTransaction: CreateTransaction<T, Self::Extrinsic>;
    type Signer: Signer<<Self::CreateTransaction as CreateTransaction<T, Self::Extrinsic>>::Public, <Self::CreateTransaction as CreateTransaction<T, Self::Extrinsic>>::Signature>;
    fn sign_and_submit(
        call: impl Into<Call>,
        public: <Self::CreateTransaction as CreateTransaction<T, Self::Extrinsic>>::Public
    ) -> Result<(), ()> { ... } }

A trait to sign and submit transactions in offchain calls.

Associated Types

type Extrinsic: ExtrinsicT<Call = Call> + Encode

Unchecked extrinsic type.

type CreateTransaction: CreateTransaction<T, Self::Extrinsic>

A runtime-specific type to produce signed data for the extrinsic.

type Signer: Signer<<Self::CreateTransaction as CreateTransaction<T, Self::Extrinsic>>::Public, <Self::CreateTransaction as CreateTransaction<T, Self::Extrinsic>>::Signature>

A type used to sign transactions created using CreateTransaction.

Loading content...

Provided methods

fn sign_and_submit(
    call: impl Into<Call>,
    public: <Self::CreateTransaction as CreateTransaction<T, Self::Extrinsic>>::Public
) -> Result<(), ()>

Sign given call and submit it to the transaction pool.

Returns Ok if the transaction was submitted correctly and Err if the key for given id was not found or the transaction was rejected from the pool.

Loading content...

Implementors

impl<T, E, S, C, Call> SubmitSignedTransaction<T, Call> for TransactionSubmitter<S, C, E> where
    T: Trait,
    C: CreateTransaction<T, E>,
    S: Signer<<C as CreateTransaction<T, E>>::Public, <C as CreateTransaction<T, E>>::Signature>,
    E: ExtrinsicT<Call = Call> + Encode
[src]

A blanket implementation to simplify creation of transaction signer & submitter in the runtime.

type Extrinsic = E

type CreateTransaction = C

type Signer = S

Loading content...