[][src]Struct sc_light::fetcher::StorageProof

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>>) -> 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>, MemCounter<Vec<u8>>> 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<T> CheckedConversion for T[src]

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

impl<T, X> Decode for X where
    T: Decode + Into<X>,
    X: WrapperTypeDecode<Wrapped = T>, 

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

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

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

impl<T, X> Encode for X where
    T: Encode + ?Sized,
    X: WrapperTypeEncode<Target = T>, 

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>> for T where
    T: Encode, 

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

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
[src]

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, U> Into<U> for T where
    U: From<T>, 
[src]

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

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

Get a reference to the inner from the outer.

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
[src]

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

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
[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<T, S> UniqueSaturatedInto<T> for S where
    S: TryInto<T>,
    T: Bounded
[src]

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