referrerpolicy=no-referrer-when-downgrade
polkadot_primitives::v8

Type Alias SignedAvailabilityBitfield

Source
pub type SignedAvailabilityBitfield = Signed<AvailabilityBitfield>;
Expand description

A bitfield signed by a particular validator about the availability of pending candidates.

Aliased Type§

struct SignedAvailabilityBitfield(/* private fields */);

Implementations

Source§

impl<Payload, RealPayload> Signed<Payload, RealPayload>

Source

pub fn into_unchecked(self) -> UncheckedSigned<Payload, RealPayload>

Convert back to an unchecked type.

Source§

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

Source

pub fn new<H: Encode>( payload: Payload, validator_index: ValidatorIndex, signature: ValidatorSignature, context: &SigningContext<H>, key: &ValidatorId, ) -> Option<Self>

Used to create a Signed from already existing parts.

The signature is checked as part of the process.

Source

pub fn sign<H: Encode>( keystore: &KeystorePtr, payload: Payload, context: &SigningContext<H>, validator_index: ValidatorIndex, key: &ValidatorId, ) -> Result<Option<Self>, KeystoreError>

Create a new Signed by signing data.

Source

pub fn try_from_unchecked<H: Encode>( unchecked: UncheckedSigned<Payload, RealPayload>, context: &SigningContext<H>, key: &ValidatorId, ) -> Result<Self, UncheckedSigned<Payload, RealPayload>>

Try to convert from UncheckedSigned by checking the signature.

Source

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

Get a reference to data as unchecked.

Source

pub fn payload(&self) -> &Payload

Immutably access the payload.

Source

pub fn validator_index(&self) -> ValidatorIndex

Immutably access the validator index.

Source

pub fn signature(&self) -> &ValidatorSignature

Immutably access the signature.

Source

pub fn into_payload(self) -> Payload

Discard signing data, get the payload

Source

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

Convert Payload into RealPayload.

Source

pub fn convert_to_superpayload<SuperPayload>( self, claimed: SuperPayload, ) -> Result<Signed<SuperPayload, RealPayload>, (Self, SuperPayload)>
where SuperPayload: EncodeAs<RealPayload>,

Convert Payload into some claimed SuperPayload if the encoding matches.

Succeeds if and only if the super-payload provided actually encodes as the expected payload.

Source

pub fn convert_to_superpayload_with<F, SuperPayload>( self, convert: F, ) -> Result<Signed<SuperPayload, RealPayload>, SuperPayload>
where F: FnOnce(Payload) -> SuperPayload, SuperPayload: EncodeAs<RealPayload>,

Convert Payload into some converted SuperPayload if the encoding matches.

This invokes the closure on the current payload, which is irreversible.

Succeeds if and only if the super-payload provided actually encodes as the expected payload.

Trait Implementations

Source§

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

Source§

fn clone(&self) -> Signed<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 Signed<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: PartialEq, RealPayload: PartialEq> PartialEq for Signed<Payload, RealPayload>

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

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

Source§

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