Type Alias polkadot_node_primitives::UncheckedSignedFullStatement
source · pub type UncheckedSignedFullStatement = UncheckedSigned<Statement, CompactStatement>;
Expand description
Variant of SignedFullStatement
where the signature has not yet been verified.
Aliased Type§
struct UncheckedSignedFullStatement { /* private fields */ }
Implementations
source§impl<Payload, RealPayload> UncheckedSigned<Payload, RealPayload>
impl<Payload, RealPayload> UncheckedSigned<Payload, RealPayload>
sourcepub fn new(
payload: Payload,
validator_index: ValidatorIndex,
signature: Signature,
) -> UncheckedSigned<Payload, RealPayload>
pub fn new( payload: Payload, validator_index: ValidatorIndex, signature: Signature, ) -> UncheckedSigned<Payload, RealPayload>
Used to create a UncheckedSigned
from already existing parts.
Signature is not checked here, hence UncheckedSigned
.
sourcepub fn try_into_checked<H>(
self,
context: &SigningContext<H>,
key: &Public,
) -> Result<Signed<Payload, RealPayload>, UncheckedSigned<Payload, RealPayload>>where
H: Encode,
pub fn try_into_checked<H>(
self,
context: &SigningContext<H>,
key: &Public,
) -> Result<Signed<Payload, RealPayload>, UncheckedSigned<Payload, RealPayload>>where
H: Encode,
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) -> &Signature
pub fn unchecked_signature(&self) -> &Signature
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
&'a Payload: for<'a> Into<RealPayload>,
pub fn unchecked_convert_payload(&self) -> UncheckedSigned<RealPayload>where
&'a Payload: for<'a> Into<RealPayload>,
Convert Payload
into RealPayload
.
sourcepub fn check_signature<H>(
&self,
context: &SigningContext<H>,
key: &Public,
) -> Result<(), ()>where
H: Encode,
pub fn check_signature<H>(
&self,
context: &SigningContext<H>,
key: &Public,
) -> Result<(), ()>where
H: Encode,
Validate the payload given the context and public key
without creating a Signed
type.
sourcepub fn benchmark_sign<H>(
public: &Public,
payload: Payload,
context: &SigningContext<H>,
validator_index: ValidatorIndex,
) -> UncheckedSigned<Payload, RealPayload>where
H: Encode,
pub fn benchmark_sign<H>(
public: &Public,
payload: Payload,
context: &SigningContext<H>,
validator_index: ValidatorIndex,
) -> UncheckedSigned<Payload, RealPayload>where
H: Encode,
Sign this payload with the given context and pair.
sourcepub fn benchmark_signature(&self) -> Signature
pub fn benchmark_signature(&self) -> Signature
Immutably access the signature.
sourcepub fn set_signature(&mut self, signature: Signature)
pub fn set_signature(&mut self, signature: Signature)
Set the signature. Only should be used for creating testing mocks.
Trait Implementations
source§impl<Payload, RealPayload> Clone for UncheckedSigned<Payload, RealPayload>
impl<Payload, RealPayload> 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>(
__codec_input_edqy: &mut __CodecInputEdqy,
) -> Result<UncheckedSigned<Payload, RealPayload>, Error>where
__CodecInputEdqy: Input,
fn decode<__CodecInputEdqy>(
__codec_input_edqy: &mut __CodecInputEdqy,
) -> Result<UncheckedSigned<Payload, RealPayload>, Error>where
__CodecInputEdqy: Input,
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>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy,
)
fn encode_to<__CodecOutputEdqy>( &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§fn from(
signed: Signed<Payload, RealPayload>,
) -> UncheckedSigned<Payload, RealPayload>
fn from( signed: Signed<Payload, RealPayload>, ) -> UncheckedSigned<Payload, RealPayload>
Converts to this type from the input type.
source§impl<Payload, RealPayload> PartialEq for UncheckedSigned<Payload, RealPayload>
impl<Payload, RealPayload> 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 ==
.