Class CheckedFlatMapProof

    • Method Summary

      Modifier and Type Method Description
      boolean containsKey​(com.google.protobuf.ByteString key)
      If this proof is valid, returns true if there is a given key in the proof; false — if there is no such key.
      static CheckedFlatMapProof correct​(HashCode rootHash, Set<MapEntry<com.google.protobuf.ByteString,​com.google.protobuf.ByteString>> entries, Set<com.google.protobuf.ByteString> missingKeys)
      Creates a valid map proof.
      com.google.protobuf.ByteString get​(com.google.protobuf.ByteString key)
      If this proof is valid, returns the value corresponding to the specified key or null if there is no such key in the proof.
      Set<MapEntry<com.google.protobuf.ByteString,​com.google.protobuf.ByteString>> getEntries()
      Get all leaf entries of this proof.
      Set<com.google.protobuf.ByteString> getMissingKeys()
      Get all keys that were requested, but did not appear in this proof.
      MapProofStatus getProofStatus()
      Returns the status of this proof: whether it is structurally valid.
      HashCode getRootHash()
      Returns the calculated root hash of the proof.
      static CheckedFlatMapProof invalid​(MapProofStatus status)
      Creates an invalid map proof.
      boolean isValid()
      Returns true if proof status is valid, false otherwise.
    • Method Detail

      • correct

        public static CheckedFlatMapProof correct​(HashCode rootHash,
                                                  Set<MapEntry<com.google.protobuf.ByteString,​com.google.protobuf.ByteString>> entries,
                                                  Set<com.google.protobuf.ByteString> missingKeys)
        Creates a valid map proof.
        Parameters:
        rootHash - the Merkle root hash calculated by the validator
        entries - the set of entries that are proved to be in the map
        missingKeys - the set of keys that are proved not to be in the map
        Returns:
        a new checked proof
      • getEntries

        public Set<MapEntry<com.google.protobuf.ByteString,​com.google.protobuf.ByteString>> getEntries()
        Description copied from interface: CheckedMapProof
        Get all leaf entries of this proof.
        Specified by:
        getEntries in interface CheckedMapProof
      • getMissingKeys

        public Set<com.google.protobuf.ByteString> getMissingKeys()
        Description copied from interface: CheckedMapProof
        Get all keys that were requested, but did not appear in this proof.
        Specified by:
        getMissingKeys in interface CheckedMapProof
      • containsKey

        public boolean containsKey​(com.google.protobuf.ByteString key)
        Description copied from interface: CheckedMapProof
        If this proof is valid, returns true if there is a given key in the proof; false — if there is no such key.
        Specified by:
        containsKey in interface CheckedMapProof
      • getRootHash

        public HashCode getRootHash()
        Description copied from interface: CheckedProof
        Returns the calculated root hash of the proof. Must be equal to the Merkle root hash of the collection, providing this proof.
        Specified by:
        getRootHash in interface CheckedProof
      • get

        public com.google.protobuf.ByteString get​(com.google.protobuf.ByteString key)
        Description copied from interface: CheckedMapProof
        If this proof is valid, returns the value corresponding to the specified key or null if there is no such key in the proof.
        Specified by:
        get in interface CheckedMapProof