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>
impl<Payload, RealPayload> Signed<Payload, RealPayload>
sourcepub fn into_unchecked(self) -> UncheckedSigned<Payload, RealPayload>
pub fn into_unchecked(self) -> UncheckedSigned<Payload, RealPayload>
Convert back to an unchecked type.
source§impl<Payload, RealPayload> Signed<Payload, RealPayload>
impl<Payload, RealPayload> Signed<Payload, RealPayload>
sourcepub fn new<H>(
payload: Payload,
validator_index: ValidatorIndex,
signature: Signature,
context: &SigningContext<H>,
key: &Public,
) -> Option<Signed<Payload, RealPayload>>where
H: Encode,
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.
sourcepub 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,
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.
sourcepub fn try_from_unchecked<H>(
unchecked: UncheckedSigned<Payload, RealPayload>,
context: &SigningContext<H>,
key: &Public,
) -> Result<Signed<Payload, RealPayload>, UncheckedSigned<Payload, RealPayload>>where
H: Encode,
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.
sourcepub fn as_unchecked(&self) -> &UncheckedSigned<Payload, RealPayload>
pub fn as_unchecked(&self) -> &UncheckedSigned<Payload, RealPayload>
Get a reference to data as unchecked.
sourcepub fn validator_index(&self) -> ValidatorIndex
pub fn validator_index(&self) -> ValidatorIndex
Immutably access the validator index.
sourcepub fn into_payload(self) -> Payload
pub fn into_payload(self) -> Payload
Discard signing data, get the payload
sourcepub fn convert_payload(&self) -> Signed<RealPayload>where
&'a Payload: for<'a> Into<RealPayload>,
pub fn convert_payload(&self) -> Signed<RealPayload>where
&'a Payload: for<'a> Into<RealPayload>,
Convert Payload
into RealPayload
.
sourcepub fn convert_to_superpayload<SuperPayload>(
self,
claimed: SuperPayload,
) -> Result<Signed<SuperPayload, RealPayload>, (Signed<Payload, RealPayload>, SuperPayload)>where
SuperPayload: EncodeAs<RealPayload>,
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.
sourcepub fn convert_to_superpayload_with<F, SuperPayload>(
self,
convert: F,
) -> Result<Signed<SuperPayload, RealPayload>, SuperPayload>
pub fn convert_to_superpayload_with<F, SuperPayload>( self, convert: F, ) -> Result<Signed<SuperPayload, RealPayload>, SuperPayload>
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.