Struct frame_system::offchain::Signer [−][src]
pub struct Signer<T: SigningTypes, C: AppCrypto<T::Public, T::Signature>, X = ForAny> { /* fields omitted */ }
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
Use all available keys for signing.
Use any of the available keys for signing.
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
impl<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>
Submit a signed transaction to the local pool. Read more
impl<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>
Submit a signed transaction to the local pool. Read more
impl<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>
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>,
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
impl<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>
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>,
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
impl<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>
Sign a message. Read more
fn 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
impl<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>
Sign a message. Read more
fn 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> 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
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self
The counterpart to unchecked_from
.
Consume self to return an equivalent value of T
.
pub fn vzip(self) -> V
impl<T> MaybeDebug for T where
T: Debug,
impl<T> MaybeDebug for T where
T: Debug,