Options
All
  • Public
  • Public/Protected
  • All
Menu

@rainblock/merkle-patricia-tree

Index

Functions

verifyStaleWitness

  • Verifies a witness against a staleRoot, constructs newest witness from the recentState and verifies it

    Parameters

    • staleRoot: Buffer

      stale root

    • key: Buffer

      key being read

    • witness: RlpWitness

      witness against a stale root

    • recentState: CachedMerklePatriciaTree<Buffer, Buffer>

      Merkle Patricia Tree horizontally caches nodes to some depth and vertically caches most recent keys

    Returns undefined | RlpWitness

verifyWitness

  • verifyWitness(root: Buffer, key: Buffer, witness: RlpWitness): void
  • Verifies that a Witness is correct for the given root and key.

    throws

    VerificationError If there was an error verifying the witness using the given key and root.

    Parameters

    • root: Buffer

      A [[Buffer]] containing the root of the tree to check

    • key: Buffer

      A [[Buffer]] containing the key to check

    • witness: RlpWitness

      The Witness to verify

    Returns void

    A promise, which is resolved if the witness was valid. Otherwise, the promise is completed exceptionally with the failure reason.

Generated using TypeDoc