Functions
constructor
function constructor(
uint8 merkleTreeHeight
) public
Create a records Merkle tree of the given height.
Parameters
Name | Type | Description |
---|---|---|
merkleTreeHeight | uint8 | The height |
_buildTreeFromFrontier
function _buildTreeFromFrontier(
struct RecordsMerkleTree.Node[] nodes
) internal returns (uint64)
Create a Merkle tree from the given frontier.
Parameters
Name | Type | Description |
---|---|---|
nodes | struct RecordsMerkleTree.Node[] | The list of nodes to be filled or updated |
Return Values
Returns | Type | Description |
---|---|---|
⇒ | struct RecordsMerkleTree.Node[] | cursor to the root node of the create tree |
updateRecordsMerkleTree
function updateRecordsMerkleTree(
uint256[] elements
) external
Update the state of the record merkle tree by inserting new elements.
Parameters
Name | Type | Description |
---|---|---|
elements | uint256[] | The list of elements to be appended to the current merkle tree described by the frontier. |
getRootValue
function getRootValue(
) external returns (uint256)
Returns the root value of the Merkle tree.
getHeight
function getHeight(
) external returns (uint8)
Returns the height of the Merkle tree.
getNumLeaves
function getNumLeaves(
) external returns (uint64)
Returns the number of leaves of the Merkle tree.