referrerpolicy=no-referrer-when-downgrade
sp_consensus_sassafras::ticket

Type Alias EphemeralSignature

pub type EphemeralSignature = CryptoBytes<sp_core::::ed25519::Signature::{constant#0}, (SignatureTag, Ed25519Tag)>;
Expand description

A signature.

Aliased Type§

struct EphemeralSignature(pub [u8; 64], _);

Fields§

§0: [u8; 64]

Implementations

§

impl<T> CryptoBytes<32, T>

pub fn from_h256(x: H256) -> CryptoBytes<32, T>

A new instance from an H256.

§

impl<T> CryptoBytes<64, T>

pub fn from_h512(x: H512) -> CryptoBytes<64, T>

A new instance from an H512.

§

impl<const N: usize, T> CryptoBytes<N, T>

pub fn from_raw(inner: [u8; N]) -> CryptoBytes<N, T>

Construct from raw array.

pub fn to_raw(self) -> [u8; N]

Construct from raw array.

pub fn as_array_ref(&self) -> &[u8; N]

Return a slice filled with raw data.

Trait Implementations

§

impl<const N: usize, T> AsMut<[u8]> for CryptoBytes<N, T>

§

fn as_mut(&mut self) -> &mut [u8]

Converts this type into a mutable reference of the (usually inferred) input type.
§

impl<const N: usize, T> AsMut<[u8; N]> for CryptoBytes<N, T>

§

fn as_mut(&mut self) -> &mut [u8; N]

Converts this type into a mutable reference of the (usually inferred) input type.
§

impl<const N: usize, T> AsRef<[u8]> for CryptoBytes<N, T>

§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
§

impl<const N: usize, T> AsRef<[u8; N]> for CryptoBytes<N, T>

§

fn as_ref(&self) -> &[u8; N]

Converts this type into a shared reference of the (usually inferred) input type.
§

impl<const N: usize, T> ByteArray for CryptoBytes<N, T>

§

const LEN: usize = N

The “length” of the values of this type, which is always the same.
§

fn from_slice(data: &[u8]) -> Result<Self, ()>

A new instance from the given slice that should be Self::LEN bytes long.
§

fn to_raw_vec(&self) -> Vec<u8>

Return a Vec<u8> filled with raw data.
§

fn as_slice(&self) -> &[u8]

Return a slice filled with raw data.
§

impl<const N: usize, T> Clone for CryptoBytes<N, T>

§

fn clone(&self) -> CryptoBytes<N, T>

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
§

impl CryptoType for CryptoBytes<sp_core::::ed25519::Signature::{constant#0}, (SignatureTag, Ed25519Tag)>

§

type Pair = Pair

The pair key type of this crypto.
§

impl<const N: usize, SubTag> Debug for CryptoBytes<N, (SignatureTag, SubTag)>
where CryptoBytes<N, (SignatureTag, SubTag)>: CryptoType,

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<const N: usize, T> Decode for CryptoBytes<N, T>
where PhantomData<fn() -> T>: Decode,

§

fn decode<__CodecInputEdqy>( __codec_input_edqy: &mut __CodecInputEdqy, ) -> Result<CryptoBytes<N, T>, Error>
where __CodecInputEdqy: Input,

Attempt to deserialise the value from input.
§

fn decode_into<__CodecInputEdqy>( __codec_input_edqy: &mut __CodecInputEdqy, dst_: &mut MaybeUninit<CryptoBytes<N, T>>, ) -> Result<DecodeFinished, Error>
where __CodecInputEdqy: Input,

Attempt to deserialize the value from input into a pre-allocated piece of memory. Read more
§

fn skip<I>(input: &mut I) -> Result<(), Error>
where I: Input,

Attempt to skip the encoded value from input. Read more
§

fn encoded_fixed_size() -> Option<usize>

Returns the fixed encoded size of the type. Read more
§

impl<const N: usize, T> Default for CryptoBytes<N, T>

§

fn default() -> CryptoBytes<N, T>

Returns the “default value” for a type. Read more
§

impl<const N: usize, T> Deref for CryptoBytes<N, T>

§

type Target = [u8]

The resulting type after dereferencing.
§

fn deref(&self) -> &<CryptoBytes<N, T> as Deref>::Target

Dereferences the value.
§

impl<'de, const N: usize, SubTag> Deserialize<'de> for CryptoBytes<N, (SignatureTag, SubTag)>
where CryptoBytes<N, (SignatureTag, SubTag)>: CryptoType,

§

fn deserialize<D>( deserializer: D, ) -> Result<CryptoBytes<N, (SignatureTag, SubTag)>, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl<const N: usize, T> Encode for CryptoBytes<N, T>
where PhantomData<fn() -> T>: Encode,

§

fn size_hint(&self) -> usize

If possible give a hint of expected size of the encoding. Read more
§

fn encode_to<__CodecOutputEdqy>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy, )
where __CodecOutputEdqy: Output + ?Sized,

Convert self to a slice and append it to the destination.
§

fn encode(&self) -> Vec<u8>

Convert self to an owned vector.
§

fn using_encoded<R, F>(&self, f: F) -> R
where F: FnOnce(&[u8]) -> R,

Convert self to a slice and then invoke the given closure with it.
§

fn encoded_size(&self) -> usize

Calculates the encoded size. Read more
§

impl<const N: usize, T> From<[u8; N]> for CryptoBytes<N, T>

§

fn from(value: [u8; N]) -> CryptoBytes<N, T>

Converts to this type from the input type.
§

impl From<Signature> for CryptoBytes<sp_core::::ed25519::Signature::{constant#0}, (SignatureTag, Ed25519Tag)>

§

fn from( outer: Signature, ) -> CryptoBytes<sp_core::::ed25519::Signature::{constant#0}, (SignatureTag, Ed25519Tag)>

Converts to this type from the input type.
§

impl<const N: usize, T> FromEntropy for CryptoBytes<N, T>

§

fn from_entropy(input: &mut impl Input) -> Result<CryptoBytes<N, T>, Error>

Create a random value of Self given a stream of random bytes on input. May only fail if input has an error.
§

impl<const N: usize, T> Hash for CryptoBytes<N, T>

§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl<const N: usize, T> MaxEncodedLen for CryptoBytes<N, T>
where PhantomData<fn() -> T>: MaxEncodedLen,

§

fn max_encoded_len() -> usize

Upper bound, in bytes, of the maximum encoded size of this item.
§

impl<const N: usize, T> Ord for CryptoBytes<N, T>

§

fn cmp(&self, other: &CryptoBytes<N, T>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
§

impl<const N: usize, T> PartialEq for CryptoBytes<N, T>

§

fn eq(&self, other: &CryptoBytes<N, T>) -> 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.
§

impl<const N: usize, T> PartialOrd for CryptoBytes<N, T>

§

fn partial_cmp(&self, other: &CryptoBytes<N, T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
§

impl<const N: usize, T> PassBy for CryptoBytes<N, T>

§

type PassBy = Inner<CryptoBytes<N, T>, [u8; N]>

The strategy that should be used to pass the type.
§

impl<const N: usize, T> PassByInner for CryptoBytes<N, T>

§

type Inner = [u8; N]

The inner type that is wrapped by Self.
§

fn into_inner(self) -> <CryptoBytes<N, T> as PassByInner>::Inner

Consumes self and returns the inner type.
§

fn inner(&self) -> &<CryptoBytes<N, T> as PassByInner>::Inner

Returns the reference to the inner type.
§

fn from_inner( inner: <CryptoBytes<N, T> as PassByInner>::Inner, ) -> CryptoBytes<N, T>

Construct Self from the given inner.
§

impl<const N: usize, SubTag> Serialize for CryptoBytes<N, (SignatureTag, SubTag)>
where CryptoBytes<N, (SignatureTag, SubTag)>: CryptoType,

§

fn serialize<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl<const N: usize, T> TryFrom<&[u8]> for CryptoBytes<N, T>

§

type Error = ()

The type returned in the event of a conversion error.
§

fn try_from( data: &[u8], ) -> Result<CryptoBytes<N, T>, <CryptoBytes<N, T> as TryFrom<&[u8]>>::Error>

Performs the conversion.
§

impl TryFrom<MultiSignature> for CryptoBytes<sp_core::::ed25519::Signature::{constant#0}, (SignatureTag, Ed25519Tag)>

§

type Error = ()

The type returned in the event of a conversion error.
§

fn try_from( m: MultiSignature, ) -> Result<CryptoBytes<sp_core::::ed25519::Signature::{constant#0}, (SignatureTag, Ed25519Tag)>, <CryptoBytes<sp_core::::ed25519::Signature::{constant#0}, (SignatureTag, Ed25519Tag)> as TryFrom<MultiSignature>>::Error>

Performs the conversion.
§

impl<const N: usize, T> TypeInfo for CryptoBytes<N, T>

§

type Identity = [u8; N]

The type identifying for which type info is provided. Read more
§

fn type_info() -> Type

Returns the static type identifier for Self.
§

impl<const N: usize, T> UncheckedFrom<[u8; N]> for CryptoBytes<N, T>

§

fn unchecked_from(data: [u8; N]) -> CryptoBytes<N, T>

Convert from an instance of T to Self. This is not guaranteed to be whatever counts as a valid instance of T and it’s up to the caller to ensure that it makes sense.
§

impl<T> UncheckedFrom<H256> for CryptoBytes<32, T>

§

fn unchecked_from(x: H256) -> CryptoBytes<32, T>

Convert from an instance of T to Self. This is not guaranteed to be whatever counts as a valid instance of T and it’s up to the caller to ensure that it makes sense.
§

impl Verify for CryptoBytes<sp_core::::ed25519::Signature::{constant#0}, (SignatureTag, Ed25519Tag)>

§

type Signer = CryptoBytes<sp_core::::ed25519::Public::{constant#0}, (PublicTag, Ed25519Tag)>

Type of the signer.
§

fn verify<L>( &self, msg: L, signer: &CryptoBytes<sp_core::::ed25519::Public::{constant#0}, (PublicTag, Ed25519Tag)>, ) -> bool
where L: Lazy<[u8]>,

Verify a signature. Read more
§

impl<const N: usize, T> Copy for CryptoBytes<N, T>

§

impl<const N: usize, T> DecodeWithMemTracking for CryptoBytes<N, T>
where PhantomData<fn() -> T>: DecodeWithMemTracking,

§

impl<const N: usize, T> EncodeLike for CryptoBytes<N, T>
where PhantomData<fn() -> T>: Encode,

§

impl<const N: usize, T> Eq for CryptoBytes<N, T>

§

impl<const N: usize, SubTag> Signature for CryptoBytes<N, (SignatureTag, SubTag)>
where CryptoBytes<N, (SignatureTag, SubTag)>: CryptoType,