Type Alias polkadot_node_primitives::SignedFullStatement

source ·
pub type SignedFullStatement = Signed<Statement, CompactStatement>;
Expand description

A statement, the corresponding signature, and the index of the sender.

Signing context and validator set should be apparent from context.

This statement is “full” in the sense that the Seconded variant includes the candidate receipt. Only the compact SignedStatement is suitable for submission to the chain.

Aliased Type§

struct SignedFullStatement(/* 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, RealPayload> Signed<Payload, RealPayload>
where Payload: EncodeAs<RealPayload>, RealPayload: Encode,

source

pub fn new<H>( payload: Payload, validator_index: ValidatorIndex, signature: Signature, context: &SigningContext<H>, key: &Public, ) -> Option<Signed<Payload, RealPayload>>
where H: Encode,

Used to create a Signed from already existing parts.

The signature is checked as part of the process.

source

pub fn sign<H>( keystore: &Arc<dyn Keystore>, payload: Payload, context: &SigningContext<H>, validator_index: ValidatorIndex, key: &Public, ) -> Result<Option<Signed<Payload, RealPayload>>, Error>
where H: Encode,

Create a new Signed by signing data.

source

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

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

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

Convert Payload into RealPayload.

source

pub fn convert_to_superpayload<SuperPayload>( self, claimed: SuperPayload, ) -> Result<Signed<SuperPayload, RealPayload>, (Signed<Payload, RealPayload>, 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, RealPayload> Clone for Signed<Payload, RealPayload>
where Payload: Clone, RealPayload: Clone,

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

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

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

source§

fn eq(&self, other: &Signed<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> Eq for Signed<Payload, RealPayload>
where Payload: Eq, RealPayload: Eq,

source§

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