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

Trait SignMessage

Source
pub trait SignMessage<T: SigningTypes> {
    type SignatureData;

    // Required methods
    fn sign_message(&self, message: &[u8]) -> Self::SignatureData;
    fn sign<TPayload, F>(&self, f: F) -> Self::SignatureData
       where F: Fn(&Account<T>) -> TPayload,
             TPayload: SignedPayload<T>;
}
Expand description

A message signer.

Required Associated Types§

Source

type SignatureData

A signature data.

May contain account used for signing and the Signature itself.

Required Methods§

Source

fn sign_message(&self, message: &[u8]) -> Self::SignatureData

Sign a message.

Implementation of this method should return a result containing the signature.

Source

fn sign<TPayload, F>(&self, f: F) -> Self::SignatureData
where F: Fn(&Account<T>) -> TPayload, TPayload: SignedPayload<T>,

Construct and sign given payload.

This method expects f to return a SignedPayload object which is then used for signing.

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§