Struct sp_state_machine::StorageProof[][src]

pub struct StorageProof { /* fields omitted */ }

A proof that some set of key-value pairs are included in the storage trie. The proof contains the storage values so that the partial storage backend can be reconstructed by a verifier that does not already have access to the key-value pairs.

The proof consists of the set of serialized nodes in the storage trie accessed when looking up the keys covered by the proof. Verifying the proof requires constructing the partial trie from the serialized nodes and performing the key lookups.

Implementations

impl StorageProof[src]

pub fn new(trie_nodes: Vec<Vec<u8, Global>, Global>) -> StorageProof[src]

Constructs a storage proof from a subset of encoded trie nodes in a storage backend.

pub fn empty() -> StorageProof[src]

Returns a new empty proof.

An empty proof is capable of only proving trivial statements (ie. that an empty set of key-value pairs exist in storage).

pub fn is_empty(&self) -> bool[src]

Returns whether this is an empty proof.

pub fn iter_nodes(self) -> StorageProofNodeIterator[src]

Create an iterator over trie nodes constructed from the proof. The nodes are not guaranteed to be traversed in any particular order.

pub fn into_memory_db<H>(
    self
) -> MemoryDB<H, HashKey<H>, Vec<u8, Global>, NoopTracker<Vec<u8, Global>>> where
    H: Hasher
[src]

Creates a MemoryDB from Self.

pub fn merge<I>(proofs: I) -> StorageProof where
    I: IntoIterator<Item = StorageProof>, 
[src]

Merges multiple storage proofs covering potentially different sets of keys into one proof covering all keys. The merged proof output may be smaller than the aggregate size of the input proofs due to deduplication of trie nodes.

Trait Implementations

impl Clone for StorageProof[src]

impl Debug for StorageProof[src]

impl Decode for StorageProof[src]

impl Encode for StorageProof[src]

impl EncodeLike<StorageProof> for StorageProof[src]

impl Eq for StorageProof[src]

impl PartialEq<StorageProof> for StorageProof[src]

impl StructuralEq for StorageProof[src]

impl StructuralPartialEq for StorageProof[src]

Auto Trait Implementations

impl RefUnwindSafe for StorageProof

impl Send for StorageProof

impl Sync for StorageProof

impl Unpin for StorageProof

impl UnwindSafe for StorageProof

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<S> Codec for S where
    S: Encode + Decode
[src]

impl<T> DecodeAll for T where
    T: Decode
[src]

impl<T> DecodeLimit for T where
    T: Decode
[src]

impl<T> DynClone for T where
    T: Clone
[src]

impl<'_, '_, T> EncodeLike<&'_ &'_ T> for T where
    T: Encode
[src]

impl<'_, T> EncodeLike<&'_ T> for T where
    T: Encode
[src]

impl<'_, T> EncodeLike<&'_ mut T> for T where
    T: Encode
[src]

impl<T> EncodeLike<Arc<T>> for T where
    T: Encode
[src]

impl<T> EncodeLike<Box<T, Global>> for T where
    T: Encode
[src]

impl<'a, T> EncodeLike<Cow<'a, T>> for T where
    T: Encode + ToOwned
[src]

impl<T> EncodeLike<Rc<T>> for T where
    T: Encode
[src]

impl<T> From<T> for T[src]

impl<S> FullCodec for S where
    S: Decode + FullEncode
[src]

impl<S> FullEncode for S where
    S: Encode + EncodeLike<S>, 
[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, Outer> IsWrappedBy<Outer> for T where
    T: From<Outer>,
    Outer: AsRef<T> + AsMut<T> + From<T>, 
[src]

pub fn from_ref(outer: &Outer) -> &T[src]

Get a reference to the inner from the outer.

pub fn from_mut(outer: &mut Outer) -> &mut T[src]

Get a mutable reference to the inner from the outer.

impl<T> KeyedVec for T where
    T: Codec
[src]

impl<T> MaybeDebug for T where
    T: Debug
[src]

impl<T> MaybeDebug for T where
    T: Debug
[src]

impl<T> MaybeRefUnwindSafe for T where
    T: RefUnwindSafe
[src]

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<S, T> UncheckedInto<T> for S where
    T: UncheckedFrom<S>, 
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]