Trait cumulus_primitives_core::relay_chain::v8::HashT

source ·
pub trait HashT: 'static + MaybeSerializeDeserialize + Debug + Clone + Eq + PartialEq + Hasher<Out = Self::Output> {
    type Output: HashOutput;

    // Required methods
    fn ordered_trie_root(
        input: Vec<Vec<u8>>,
        state_version: StateVersion,
    ) -> Self::Output;
    fn trie_root(
        input: Vec<(Vec<u8>, Vec<u8>)>,
        state_version: StateVersion,
    ) -> Self::Output;

    // Provided methods
    fn hash(s: &[u8]) -> Self::Output { ... }
    fn hash_of<S>(s: &S) -> Self::Output
       where S: Encode { ... }
}
Expand description

Abstraction around hashing

Required Associated Types§

source

type Output: HashOutput

The hash type produced.

Required Methods§

source

fn ordered_trie_root( input: Vec<Vec<u8>>, state_version: StateVersion, ) -> Self::Output

The ordered Patricia tree root of the given input.

source

fn trie_root( input: Vec<(Vec<u8>, Vec<u8>)>, state_version: StateVersion, ) -> Self::Output

The Patricia tree root of the given mapping.

Provided Methods§

source

fn hash(s: &[u8]) -> Self::Output

Produce the hash of some byte-slice.

source

fn hash_of<S>(s: &S) -> Self::Output
where S: Encode,

Produce the hash of some codec-encodable value.

Object Safety§

This trait is not object safe.

Implementors§