Type Alias polkadot_primitives::v8::UncheckedSignedAvailabilityBitfield
source · 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>
impl<Payload, RealPayload> Decode for UncheckedSigned<Payload, RealPayload>
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<Payload, RealPayload> Encode for UncheckedSigned<Payload, RealPayload>
impl<Payload, RealPayload> Encode for UncheckedSigned<Payload, RealPayload>
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>(&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.
source§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
This method tests for
self
and other
values to be equal, and is used
by ==
.