Struct sc_light::fetcher::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.


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>(
) -> MemoryDB<H, HashKey<H>, Vec<u8, Global>, MemCounter<Vec<u8, Global>>> where
    H: Hasher, 

Creates a MemoryDB from Self.

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

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

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> CheckedConversion for T[src]

impl<S> Codec for S where
    S: Decode + Encode, 

impl<T> DecodeAll for T where
    T: Decode, 

impl<T> DecodeLimit for T where
    T: Decode, 

impl<T> DynClone for T where
    T: Clone

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

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

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

impl<T> EncodeLike<Arc<T>> for T where
    T: Encode, 

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

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

impl<T> EncodeLike<Rc<T>> for T where
    T: Encode, 

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized

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

impl<S> FullCodec for S where
    S: Decode + FullEncode, 

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

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

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

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, 

impl<T> MaybeDebug for T where
    T: Debug

impl<T> MaybeDebug for T where
    T: Debug

impl<T> MaybeRefUnwindSafe for T where
    T: RefUnwindSafe

impl<T> Member for T where
    T: 'static + Send + Sync + Debug + Eq + PartialEq<T> + Clone

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> SaturatedConversion for T[src]

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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>, 

impl<T, S> UniqueSaturatedInto<T> for S where
    S: TryInto<T>,
    T: Bounded

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]