referrerpolicy=no-referrer-when-downgrade
frame_system::offchain

Trait SendUnsignedTransaction

Source
pub trait SendUnsignedTransaction<T: SigningTypes + CreateInherent<LocalCall>, LocalCall> {
    type Result;

    // Required method
    fn send_unsigned_transaction<TPayload, F>(
        &self,
        f: F,
        f2: impl Fn(TPayload, T::Signature) -> LocalCall,
    ) -> Self::Result
       where F: Fn(&Account<T>) -> TPayload,
             TPayload: SignedPayload<T>;

    // Provided method
    fn submit_unsigned_transaction(
        &self,
        call: LocalCall,
    ) -> Option<Result<(), ()>> { ... }
}
Expand description

Submit an unsigned transaction onchain with a signed payload

Required Associated Types§

Source

type Result

A submission result.

Should contain the submission result and the account(s) that signed the payload.

Required Methods§

Source

fn send_unsigned_transaction<TPayload, F>( &self, f: F, f2: impl Fn(TPayload, T::Signature) -> LocalCall, ) -> Self::Result
where F: Fn(&Account<T>) -> TPayload, TPayload: SignedPayload<T>,

Send an unsigned transaction with a signed payload.

This method takes f and f2 where:

  • f is called for every account and is expected to return a SignedPayload object.
  • f2 is then called with the SignedPayload returned by f and the signature and is expected to return a Call object to be embedded into transaction.

Provided Methods§

Source

fn submit_unsigned_transaction(&self, call: LocalCall) -> Option<Result<(), ()>>

Submits an unsigned call to the transaction pool.

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§

Source§

impl<T: SigningTypes + CreateInherent<LocalCall>, C: AppCrypto<T::Public, T::Signature>, LocalCall> SendUnsignedTransaction<T, LocalCall> for Signer<T, C, ForAll>

Source§

impl<T: SigningTypes + CreateInherent<LocalCall>, C: AppCrypto<T::Public, T::Signature>, LocalCall> SendUnsignedTransaction<T, LocalCall> for Signer<T, C, ForAny>