Type Alias polkadot_primitives::v8::UncheckedSignedStatement

source ·
pub type UncheckedSignedStatement = UncheckedSigned<CompactStatement>;
Expand description

A signed compact statement, with signature not yet checked.

Aliased Type§

struct UncheckedSignedStatement { /* private fields */ }

Implementations

source§

impl<Payload: EncodeAs<RealPayload>, RealPayload: Encode> UncheckedSigned<Payload, RealPayload>

source

pub fn new( payload: Payload, validator_index: ValidatorIndex, signature: ValidatorSignature, ) -> Self

Used to create a UncheckedSigned from already existing parts.

Signature is not checked here, hence UncheckedSigned.

source

pub fn try_into_checked<H: Encode>( self, context: &SigningContext<H>, key: &ValidatorId, ) -> Result<Signed<Payload, RealPayload>, Self>

Check signature and convert to Signed if successful.

source

pub fn unchecked_payload(&self) -> &Payload

Immutably access the payload.

source

pub fn unchecked_validator_index(&self) -> ValidatorIndex

Immutably access the validator index.

source

pub fn unchecked_signature(&self) -> &ValidatorSignature

Immutably access the signature.

source

pub fn unchecked_into_payload(self) -> Payload

Discard signing data, get the payload

source

pub fn unchecked_convert_payload(&self) -> UncheckedSigned<RealPayload>
where for<'a> &'a Payload: Into<RealPayload>,

Convert Payload into RealPayload.

source

pub fn check_signature<H: Encode>( &self, context: &SigningContext<H>, key: &ValidatorId, ) -> Result<(), ()>

Validate the payload given the context and public key without creating a Signed type.

source

pub fn benchmark_sign<H: Encode>( public: &ValidatorId, payload: Payload, context: &SigningContext<H>, validator_index: ValidatorIndex, ) -> Self

Sign this payload with the given context and pair.

source

pub fn benchmark_signature(&self) -> ValidatorSignature

Immutably access the signature.

source

pub fn set_signature(&mut self, signature: ValidatorSignature)

Set the signature. Only should be used for creating testing mocks.

Trait Implementations

source§

impl<Payload: Clone, RealPayload: Clone> Clone for UncheckedSigned<Payload, RealPayload>

source§

fn clone(&self) -> UncheckedSigned<Payload, RealPayload>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Payload, RealPayload> Debug for UncheckedSigned<Payload, RealPayload>
where Payload: Debug, RealPayload: Debug,

source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Payload, RealPayload> Decode for UncheckedSigned<Payload, RealPayload>
where Payload: Decode, PhantomData<RealPayload>: Decode,

source§

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,

Attempt to deserialize the value from input into a pre-allocated piece of memory. Read more
source§

fn skip<I>(input: &mut I) -> Result<(), Error>
where I: Input,

Attempt to skip the encoded value from input. Read more
source§

fn encoded_fixed_size() -> Option<usize>

Returns the fixed encoded size of the type. Read more
source§

impl<Payload, RealPayload> Encode for UncheckedSigned<Payload, RealPayload>
where Payload: Encode, PhantomData<RealPayload>: Encode,

source§

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, )

Convert self to a slice and append it to the destination.
source§

fn encode(&self) -> Vec<u8>

Convert self to an owned vector.
source§

fn using_encoded<R, F>(&self, f: F) -> R
where F: FnOnce(&[u8]) -> R,

Convert self to a slice and then invoke the given closure with it.
source§

fn encoded_size(&self) -> usize

Calculates the encoded size. Read more
source§

impl<Payload, RealPayload> From<Signed<Payload, RealPayload>> for UncheckedSigned<Payload, RealPayload>

source§

fn from(signed: Signed<Payload, RealPayload>) -> Self

Converts to this type from the input type.
source§

impl<Payload: PartialEq, RealPayload: PartialEq> PartialEq for UncheckedSigned<Payload, RealPayload>

source§

fn eq(&self, other: &UncheckedSigned<Payload, RealPayload>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<Payload, RealPayload> TypeInfo for UncheckedSigned<Payload, RealPayload>
where Payload: TypeInfo + 'static, PhantomData<RealPayload>: TypeInfo + 'static, RealPayload: TypeInfo + 'static,

§

type Identity = UncheckedSigned<Payload, RealPayload>

The type identifying for which type info is provided. Read more
source§

fn type_info() -> Type

Returns the static type identifier for Self.
source§

impl<Payload, RealPayload> EncodeLike for UncheckedSigned<Payload, RealPayload>
where Payload: Encode, PhantomData<RealPayload>: Encode,

source§

impl<Payload: Eq, RealPayload: Eq> Eq for UncheckedSigned<Payload, RealPayload>

source§

impl<Payload, RealPayload> StructuralPartialEq for UncheckedSigned<Payload, RealPayload>