Struct bp_runtime::extensions::GenericSignedExtension
source · pub struct GenericSignedExtension<S: SignedExtensionSchema> {
pub payload: S::Payload,
/* private fields */
}
Expand description
A simplified version of signed extensions meant for producing signed transactions and signed payloads in the client code.
Fields§
§payload: S::Payload
Implementations§
source§impl<S: SignedExtensionSchema> GenericSignedExtension<S>
impl<S: SignedExtensionSchema> GenericSignedExtension<S>
pub fn new( payload: S::Payload, additional_signed: Option<S::AdditionalSigned> ) -> Self
Trait Implementations§
source§impl<S: Clone + SignedExtensionSchema> Clone for GenericSignedExtension<S>where
S::Payload: Clone,
S::AdditionalSigned: Clone,
impl<S: Clone + SignedExtensionSchema> Clone for GenericSignedExtension<S>where S::Payload: Clone, S::AdditionalSigned: Clone,
source§fn clone(&self) -> GenericSignedExtension<S>
fn clone(&self) -> GenericSignedExtension<S>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<S: Debug + SignedExtensionSchema> Debug for GenericSignedExtension<S>where
S::Payload: Debug,
S::AdditionalSigned: Debug,
impl<S: Debug + SignedExtensionSchema> Debug for GenericSignedExtension<S>where S::Payload: Debug, S::AdditionalSigned: Debug,
source§impl<S: SignedExtensionSchema> Decode for GenericSignedExtension<S>where
S::Payload: Decode,
Option<S::AdditionalSigned>: Default,
impl<S: SignedExtensionSchema> Decode for GenericSignedExtension<S>where S::Payload: Decode, Option<S::AdditionalSigned>: Default,
source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<Self, Error>
fn decode<__CodecInputEdqy: Input>( __codec_input_edqy: &mut __CodecInputEdqy ) -> Result<Self, Error>
Attempt to deserialise the value from input.
source§fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>
) -> Result<DecodeFinished, Error>where
I: Input,
fn decode_into<I>( input: &mut I, dst: &mut MaybeUninit<Self> ) -> Result<DecodeFinished, Error>where I: Input,
Attempt to deserialize the value from input into a pre-allocated piece of memory. Read more
source§impl<S: SignedExtensionSchema> Encode for GenericSignedExtension<S>where
S::Payload: Encode,
impl<S: SignedExtensionSchema> Encode for GenericSignedExtension<S>where S::Payload: Encode,
source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
If possible give a hint of expected size of the encoding. Read more
source§fn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy
)
fn encode_to<__CodecOutputEdqy: Output + ?Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy )
Convert self to a slice and append it to the destination.
source§fn using_encoded<R, F: FnOnce(&[u8]) -> R>(&self, f: F) -> R
fn using_encoded<R, F: FnOnce(&[u8]) -> R>(&self, f: F) -> R
Convert self to a slice and then invoke the given closure with it.
source§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Calculates the encoded size. Read more
source§impl<S: PartialEq + SignedExtensionSchema> PartialEq for GenericSignedExtension<S>where
S::Payload: PartialEq,
S::AdditionalSigned: PartialEq,
impl<S: PartialEq + SignedExtensionSchema> PartialEq for GenericSignedExtension<S>where S::Payload: PartialEq, S::AdditionalSigned: PartialEq,
source§fn eq(&self, other: &GenericSignedExtension<S>) -> bool
fn eq(&self, other: &GenericSignedExtension<S>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<S> SignedExtension for GenericSignedExtension<S>where
S: SignedExtensionSchema,
S::Payload: Send + Sync,
S::AdditionalSigned: Send + Sync,
impl<S> SignedExtension for GenericSignedExtension<S>where S: SignedExtensionSchema, S::Payload: Send + Sync, S::AdditionalSigned: Send + Sync,
source§const IDENTIFIER: &'static str = "Not needed."
const IDENTIFIER: &'static str = "Not needed."
Unique identifier of this signed extension. Read more
§type AdditionalSigned = <S as SignedExtensionSchema>::AdditionalSigned
type AdditionalSigned = <S as SignedExtensionSchema>::AdditionalSigned
Any additional data that will go into the signed payload. This may be created dynamically
from the transaction using the
additional_signed
function.§type Pre = ()
type Pre = ()
The type that encodes information that can be passed from pre_dispatch to post-dispatch.
source§fn additional_signed(
&self
) -> Result<Self::AdditionalSigned, TransactionValidityError>
fn additional_signed( &self ) -> Result<Self::AdditionalSigned, TransactionValidityError>
Construct any additional data that should be in the signed payload of the transaction. Can
also perform any pre-signature-verification checks and return an error if needed.
source§fn pre_dispatch(
self,
_who: &Self::AccountId,
_call: &Self::Call,
_info: &DispatchInfoOf<Self::Call>,
_len: usize
) -> Result<Self::Pre, TransactionValidityError>
fn pre_dispatch( self, _who: &Self::AccountId, _call: &Self::Call, _info: &DispatchInfoOf<Self::Call>, _len: usize ) -> Result<Self::Pre, TransactionValidityError>
Do any pre-flight stuff for a signed transaction. Read more
source§fn validate(
&self,
_who: &Self::AccountId,
_call: &Self::Call,
_info: &<Self::Call as Dispatchable>::Info,
_len: usize
) -> Result<ValidTransaction, TransactionValidityError>
fn validate( &self, _who: &Self::AccountId, _call: &Self::Call, _info: &<Self::Call as Dispatchable>::Info, _len: usize ) -> Result<ValidTransaction, TransactionValidityError>
Validate a signed transaction for the transaction queue. Read more
source§fn validate_unsigned(
_call: &Self::Call,
_info: &<Self::Call as Dispatchable>::Info,
_len: usize
) -> Result<ValidTransaction, TransactionValidityError>
fn validate_unsigned( _call: &Self::Call, _info: &<Self::Call as Dispatchable>::Info, _len: usize ) -> Result<ValidTransaction, TransactionValidityError>
Validate an unsigned transaction for the transaction queue. Read more
source§fn pre_dispatch_unsigned(
call: &Self::Call,
info: &<Self::Call as Dispatchable>::Info,
len: usize
) -> Result<(), TransactionValidityError>
fn pre_dispatch_unsigned( call: &Self::Call, info: &<Self::Call as Dispatchable>::Info, len: usize ) -> Result<(), TransactionValidityError>
Do any pre-flight stuff for a unsigned transaction. Read more
source§fn post_dispatch(
_pre: Option<Self::Pre>,
_info: &<Self::Call as Dispatchable>::Info,
_post_info: &<Self::Call as Dispatchable>::PostInfo,
_len: usize,
_result: &Result<(), DispatchError>
) -> Result<(), TransactionValidityError>
fn post_dispatch( _pre: Option<Self::Pre>, _info: &<Self::Call as Dispatchable>::Info, _post_info: &<Self::Call as Dispatchable>::PostInfo, _len: usize, _result: &Result<(), DispatchError> ) -> Result<(), TransactionValidityError>
Do any post-flight stuff for an extrinsic. Read more
source§impl<S> TypeInfo for GenericSignedExtension<S>where
S::Payload: TypeInfo + 'static,
Option<S::AdditionalSigned>: TypeInfo + 'static,
S: SignedExtensionSchema + TypeInfo + 'static,
impl<S> TypeInfo for GenericSignedExtension<S>where S::Payload: TypeInfo + 'static, Option<S::AdditionalSigned>: TypeInfo + 'static, S: SignedExtensionSchema + TypeInfo + 'static,
impl<S: SignedExtensionSchema> EncodeLike for GenericSignedExtension<S>where S::Payload: Encode,
impl<S: Eq + SignedExtensionSchema> Eq for GenericSignedExtension<S>where S::Payload: Eq, S::AdditionalSigned: Eq,
impl<S: SignedExtensionSchema> StructuralEq for GenericSignedExtension<S>
impl<S: SignedExtensionSchema> StructuralPartialEq for GenericSignedExtension<S>
Auto Trait Implementations§
impl<S> RefUnwindSafe for GenericSignedExtension<S>where <S as SignedExtensionSchema>::AdditionalSigned: RefUnwindSafe, <S as SignedExtensionSchema>::Payload: RefUnwindSafe,
impl<S> Send for GenericSignedExtension<S>where <S as SignedExtensionSchema>::AdditionalSigned: Send, <S as SignedExtensionSchema>::Payload: Send,
impl<S> Sync for GenericSignedExtension<S>where <S as SignedExtensionSchema>::AdditionalSigned: Sync, <S as SignedExtensionSchema>::Payload: Sync,
impl<S> Unpin for GenericSignedExtension<S>where <S as SignedExtensionSchema>::AdditionalSigned: Unpin, <S as SignedExtensionSchema>::Payload: Unpin,
impl<S> UnwindSafe for GenericSignedExtension<S>where <S as SignedExtensionSchema>::AdditionalSigned: UnwindSafe, <S as SignedExtensionSchema>::Payload: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
source§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere T: Decode,
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T, Outer> IsWrappedBy<Outer> for Twhere
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
impl<T, Outer> IsWrappedBy<Outer> for Twhere Outer: AsRef<T> + AsMut<T> + From<T>, T: From<Outer>,
§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere Self: UniqueSaturatedFrom<T>,
§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere Self: UniqueSaturatedInto<T>,
Consume self to return an equivalent value of
T
. Read moresource§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere T: UncheckedFrom<S>,
source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
The counterpart to
unchecked_from
.§impl<T, S> UniqueSaturatedInto<T> for Swhere
T: Bounded,
S: TryInto<T>,
impl<T, S> UniqueSaturatedInto<T> for Swhere T: Bounded, S: TryInto<T>,
§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of
T
.