pub type UncheckedSignedFullStatement = UncheckedSigned<Statement, CompactStatement>;
Expand description

Variant of SignedFullStatement where the signature has not yet been verified.

Aliased Type§

struct UncheckedSignedFullStatement { /* private fields */ }

Implementations

source§

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

source

pub fn new( payload: Payload, validator_index: ValidatorIndex, signature: Signature, ) -> UncheckedSigned<Payload, RealPayload>

Used to create a UncheckedSigned from already existing parts.

Signature is not checked here, hence UncheckedSigned.

source

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

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) -> &Signature

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 &'a Payload: for<'a> Into<RealPayload>,

Convert Payload into RealPayload.

source

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

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

source

pub fn benchmark_sign<H>( public: &Public, payload: Payload, context: &SigningContext<H>, validator_index: ValidatorIndex, ) -> UncheckedSigned<Payload, RealPayload>
where H: Encode,

Sign this payload with the given context and pair.

source

pub fn benchmark_signature(&self) -> Signature

Immutably access the signature.

source

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

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

Trait Implementations

source§

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

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

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>( __codec_input_edqy: &mut __CodecInputEdqy, ) -> Result<UncheckedSigned<Payload, RealPayload>, Error>
where __CodecInputEdqy: Input,

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>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy, )
where __CodecOutputEdqy: Output + ?Sized,

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>, ) -> UncheckedSigned<Payload, RealPayload>

Converts to this type from the input type.
source§

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

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, RealPayload> Eq for UncheckedSigned<Payload, RealPayload>
where Payload: Eq, RealPayload: Eq,

source§

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