Struct frame_system::offchain::Signer
source · [−]pub struct Signer<T: SigningTypes, C: AppCrypto<T::Public, T::Signature>, X = ForAny> { /* private fields */ }
Expand description
Provides an implementation for signing transaction payloads.
Keys used for signing are defined when instantiating the signer object. Signing can be done using:
- All supported keys in the keystore
- Any of the supported keys in the keystore
- An intersection of in-keystore keys and the list of provided keys
The signer is then able to:
- Submit a unsigned transaction with a signed payload
- Submit a signed transaction
Implementations
sourceimpl<T: SigningTypes, C: AppCrypto<T::Public, T::Signature>, X> Signer<T, C, X>
impl<T: SigningTypes, C: AppCrypto<T::Public, T::Signature>, X> Signer<T, C, X>
sourcepub fn all_accounts() -> Signer<T, C, ForAll>
pub fn all_accounts() -> Signer<T, C, ForAll>
Use all available keys for signing.
sourcepub fn any_account() -> Signer<T, C, ForAny>
pub fn any_account() -> Signer<T, C, ForAny>
Use any of the available keys for signing.
sourcepub fn with_filter(self, accounts: Vec<T::Public>) -> Self
pub fn with_filter(self, accounts: Vec<T::Public>) -> Self
Use provided accounts
for signing.
Note that not all keys will be necessarily used. The provided vector of accounts will be intersected with the supported keys in the keystore and the resulting list will be used for signing.
Trait Implementations
sourceimpl<T: SigningTypes, C: AppCrypto<T::Public, T::Signature>, X> Debug for Signer<T, C, X> where
T: Debug,
C: Debug,
X: Debug,
impl<T: SigningTypes, C: AppCrypto<T::Public, T::Signature>, X> Debug for Signer<T, C, X> where
T: Debug,
C: Debug,
X: Debug,
sourceimpl<T: CreateSignedTransaction<LocalCall> + SigningTypes, C: AppCrypto<T::Public, T::Signature>, LocalCall> SendSignedTransaction<T, C, LocalCall> for Signer<T, C, ForAny>
impl<T: CreateSignedTransaction<LocalCall> + SigningTypes, C: AppCrypto<T::Public, T::Signature>, LocalCall> SendSignedTransaction<T, C, LocalCall> for Signer<T, C, ForAny>
sourceimpl<T: SigningTypes + CreateSignedTransaction<LocalCall>, C: AppCrypto<T::Public, T::Signature>, LocalCall> SendSignedTransaction<T, C, LocalCall> for Signer<T, C, ForAll>
impl<T: SigningTypes + CreateSignedTransaction<LocalCall>, C: AppCrypto<T::Public, T::Signature>, LocalCall> SendSignedTransaction<T, C, LocalCall> for Signer<T, C, ForAll>
sourceimpl<T: SigningTypes + SendTransactionTypes<LocalCall>, C: AppCrypto<T::Public, T::Signature>, LocalCall> SendUnsignedTransaction<T, LocalCall> for Signer<T, C, ForAny>
impl<T: SigningTypes + SendTransactionTypes<LocalCall>, C: AppCrypto<T::Public, T::Signature>, LocalCall> SendUnsignedTransaction<T, LocalCall> for Signer<T, C, ForAny>
sourcefn 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>,
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. Read more
sourceimpl<T: SigningTypes + SendTransactionTypes<LocalCall>, C: AppCrypto<T::Public, T::Signature>, LocalCall> SendUnsignedTransaction<T, LocalCall> for Signer<T, C, ForAll>
impl<T: SigningTypes + SendTransactionTypes<LocalCall>, C: AppCrypto<T::Public, T::Signature>, LocalCall> SendUnsignedTransaction<T, LocalCall> for Signer<T, C, ForAll>
sourcefn 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>,
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. Read more
sourceimpl<T: SigningTypes, C: AppCrypto<T::Public, T::Signature>> SignMessage<T> for Signer<T, C, ForAll>
impl<T: SigningTypes, C: AppCrypto<T::Public, T::Signature>> SignMessage<T> for Signer<T, C, ForAll>
sourcefn sign_message(&self, message: &[u8]) -> Self::SignatureData
fn sign_message(&self, message: &[u8]) -> Self::SignatureData
Sign a message. Read more
sourcefn sign<TPayload, F>(&self, f: F) -> Self::SignatureData where
F: Fn(&Account<T>) -> TPayload,
TPayload: SignedPayload<T>,
fn sign<TPayload, F>(&self, f: F) -> Self::SignatureData where
F: Fn(&Account<T>) -> TPayload,
TPayload: SignedPayload<T>,
Construct and sign given payload. Read more
sourceimpl<T: SigningTypes, C: AppCrypto<T::Public, T::Signature>> SignMessage<T> for Signer<T, C, ForAny>
impl<T: SigningTypes, C: AppCrypto<T::Public, T::Signature>> SignMessage<T> for Signer<T, C, ForAny>
sourcefn sign_message(&self, message: &[u8]) -> Self::SignatureData
fn sign_message(&self, message: &[u8]) -> Self::SignatureData
Sign a message. Read more
sourcefn sign<TPayload, F>(&self, f: F) -> Self::SignatureData where
F: Fn(&Account<T>) -> TPayload,
TPayload: SignedPayload<T>,
fn sign<TPayload, F>(&self, f: F) -> Self::SignatureData where
F: Fn(&Account<T>) -> TPayload,
TPayload: SignedPayload<T>,
Construct and sign given payload. Read more
Auto Trait Implementations
impl<T, C, X> RefUnwindSafe for Signer<T, C, X> where
C: RefUnwindSafe,
X: RefUnwindSafe,
<T as SigningTypes>::Public: RefUnwindSafe,
impl<T, C, X> Send for Signer<T, C, X> where
C: Send,
X: Send,
<T as SigningTypes>::Public: Send,
impl<T, C, X> Sync for Signer<T, C, X> where
C: Sync,
X: Sync,
<T as SigningTypes>::Public: Sync,
impl<T, C, X> Unpin for Signer<T, C, X> where
C: Unpin,
X: Unpin,
<T as SigningTypes>::Public: Unpin,
impl<T, C, X> UnwindSafe for Signer<T, C, X> where
C: UnwindSafe,
X: UnwindSafe,
<T as SigningTypes>::Public: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> CheckedConversion for T
impl<T> CheckedConversion for T
sourcefn checked_from<T>(t: T) -> Option<Self> where
Self: TryFrom<T>,
fn checked_from<T>(t: T) -> Option<Self> where
Self: TryFrom<T>,
Convert from a value of T
into an equivalent instance of Option<Self>
. Read more
sourcefn checked_into<T>(self) -> Option<T> where
Self: TryInto<T>,
fn checked_into<T>(self) -> Option<T> where
Self: TryInto<T>,
Consume self to return Some
equivalent value of Option<T>
. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T, Outer> IsWrappedBy<Outer> for T where
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
impl<T, Outer> IsWrappedBy<Outer> for T where
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
sourceimpl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
sourcefn saturated_from<T>(t: T) -> Self where
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Self where
Self: UniqueSaturatedFrom<T>,
Convert from a value of T
into an equivalent instance of Self
. Read more
sourcefn saturated_into<T>(self) -> T where
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> T where
Self: UniqueSaturatedInto<T>,
Consume self to return an equivalent value of T
. Read more
sourceimpl<S, T> UncheckedInto<T> for S where
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for S where
T: UncheckedFrom<S>,
sourcepub fn unchecked_into(self) -> T
pub fn unchecked_into(self) -> T
The counterpart to unchecked_from
.
sourceimpl<T, S> UniqueSaturatedInto<T> for S where
T: Bounded,
S: TryInto<T>,
impl<T, S> UniqueSaturatedInto<T> for S where
T: Bounded,
S: TryInto<T>,
sourcepub fn unique_saturated_into(self) -> T
pub fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of T
.