pub type UncheckedSignedAvailabilityBitfield = UncheckedSigned<AvailabilityBitfield>;
Expand description
A signed bitfield with signature not yet checked.
Aliased Type§
struct UncheckedSignedAvailabilityBitfield { /* private fields */ }
Implementations
Source§impl<Payload: EncodeAs<RealPayload>, RealPayload: Encode> UncheckedSigned<Payload, RealPayload>
impl<Payload: EncodeAs<RealPayload>, RealPayload: Encode> UncheckedSigned<Payload, RealPayload>
Sourcepub fn new(
payload: Payload,
validator_index: ValidatorIndex,
signature: ValidatorSignature,
) -> Self
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
.
Sourcepub fn try_into_checked<H: Encode>(
self,
context: &SigningContext<H>,
key: &ValidatorId,
) -> Result<Signed<Payload, RealPayload>, Self>
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.
Sourcepub fn unchecked_payload(&self) -> &Payload
pub fn unchecked_payload(&self) -> &Payload
Immutably access the payload.
Sourcepub fn unchecked_validator_index(&self) -> ValidatorIndex
pub fn unchecked_validator_index(&self) -> ValidatorIndex
Immutably access the validator index.
Sourcepub fn unchecked_signature(&self) -> &ValidatorSignature
pub fn unchecked_signature(&self) -> &ValidatorSignature
Immutably access the signature.
Sourcepub fn unchecked_into_payload(self) -> Payload
pub fn unchecked_into_payload(self) -> Payload
Discard signing data, get the payload
Sourcepub fn unchecked_convert_payload(&self) -> UncheckedSigned<RealPayload>where
for<'a> &'a Payload: Into<RealPayload>,
pub fn unchecked_convert_payload(&self) -> UncheckedSigned<RealPayload>where
for<'a> &'a Payload: Into<RealPayload>,
Convert Payload
into RealPayload
.
Sourcepub fn check_signature<H: Encode>(
&self,
context: &SigningContext<H>,
key: &ValidatorId,
) -> Result<(), ()>
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.
Sourcepub fn benchmark_sign<H: Encode>(
public: &ValidatorId,
payload: Payload,
context: &SigningContext<H>,
validator_index: ValidatorIndex,
) -> Self
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.
Sourcepub fn benchmark_signature(&self) -> ValidatorSignature
pub fn benchmark_signature(&self) -> ValidatorSignature
Immutably access the signature.
Sourcepub fn set_signature(&mut self, signature: ValidatorSignature)
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>
impl<Payload: Clone, RealPayload: Clone> Clone for UncheckedSigned<Payload, RealPayload>
Source§fn clone(&self) -> UncheckedSigned<Payload, RealPayload>
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)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<Payload, RealPayload> Debug for UncheckedSigned<Payload, RealPayload>
impl<Payload, RealPayload> Debug for UncheckedSigned<Payload, RealPayload>
Source§impl<Payload, RealPayload> Decode for UncheckedSigned<Payload, RealPayload>where
Payload: Decode,
PhantomData<RealPayload>: Decode,
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>
fn decode<__CodecInputEdqy: Input>( __codec_input_edqy: &mut __CodecInputEdqy, ) -> Result<Self, Error>
Attempt to deserialise the value from input.
§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
§fn skip<I>(input: &mut I) -> Result<(), Error>where
I: Input,
fn skip<I>(input: &mut I) -> Result<(), Error>where
I: Input,
Attempt to skip the encoded value from input. Read more
§fn encoded_fixed_size() -> Option<usize>
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,
impl<Payload, RealPayload> Encode for UncheckedSigned<Payload, RealPayload>where
Payload: Encode,
PhantomData<RealPayload>: 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.
§fn using_encoded<R, F>(&self, f: F) -> R
fn using_encoded<R, F>(&self, f: F) -> R
Convert self to a slice and then invoke the given closure with it.
§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Calculates the encoded size. Read more
Source§impl<Payload, RealPayload> From<Signed<Payload, RealPayload>> for UncheckedSigned<Payload, RealPayload>
impl<Payload, RealPayload> From<Signed<Payload, RealPayload>> for UncheckedSigned<Payload, RealPayload>
Source§impl<Payload: PartialEq, RealPayload: PartialEq> PartialEq for UncheckedSigned<Payload, RealPayload>
impl<Payload: PartialEq, RealPayload: PartialEq> PartialEq for UncheckedSigned<Payload, RealPayload>
Source§fn eq(&self, other: &UncheckedSigned<Payload, RealPayload>) -> bool
fn eq(&self, other: &UncheckedSigned<Payload, RealPayload>) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.