UNPKG

@iden3/js-merkletree

Version:

javascript sparse merkle tree library

28 lines (27 loc) 1.7 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ErrNotWritable = exports.ErrEntryIndexAlreadyExists = exports.ErrInvalidDBValue = exports.ErrInvalidProofBytes = exports.ErrInvalidNodeFound = exports.ErrReachedMaxLevel = exports.ErrNodeBytesBadSize = exports.ErrKeyNotFound = exports.ErrNodeKeyAlreadyExists = void 0; exports.ErrNodeKeyAlreadyExists = 'key already exists'; // ErrKeyNotFound is used when a key is not found in the MerkleTree. exports.ErrKeyNotFound = 'Key not found in the MerkleTree'; // ErrNodeBytesBadSize is used when the data of a node has an incorrect // size and can't be parsed. exports.ErrNodeBytesBadSize = 'node data has incorrect size in the DB'; // ErrReachedMaxLevel is used when a traversal of the MT reaches the // maximum level. exports.ErrReachedMaxLevel = 'reached maximum level of the merkle tree'; // ErrInvalidNodeFound is used when an invalid node is found and can't // be parsed. exports.ErrInvalidNodeFound = 'found an invalid node in the DB'; // ErrInvalidProofBytes is used when a serialized proof is invalid. exports.ErrInvalidProofBytes = 'the serialized proof is invalid'; // ErrInvalidDBValue is used when a value in the key value DB is // invalid (for example, it doen't contain a byte header and a []byte // body of at least len=1. exports.ErrInvalidDBValue = 'the value in the DB is invalid'; // ErrEntryIndexAlreadyExists is used when the entry index already // exists in the tree. exports.ErrEntryIndexAlreadyExists = 'the entry index already exists in the tree'; // ErrNotWritable is used when the MerkleTree is not writable and a // write function is called exports.ErrNotWritable = 'Merkle Tree not writable';