Skip to content

BinaryStateTree.merkelize

Merkelizes a Binary State Tree.

Imports

Named
import { BinaryStateTree } from 'ox'

Examples

import { BinaryStateTree, Bytes } from 'ox'
 
const tree = BinaryStateTree.create()
 
BinaryStateTree.insert(
  tree,
  Bytes.fromHex('0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54'),
  Bytes.fromHex('0xd4fd4e189132273036449fc9e11198c739161b4c0116a9a2dccdfa1c492006f1')
)
 
const hash = BinaryStateTree.merkelize(tree)

Definition

function merkelize(
  tree: BinaryStateTree.BinaryStateTree,
): Bytes.Bytes

Source: src/core/BinaryStateTree.ts

Parameters

tree

Binary State Tree instance.

tree.root

  • Type: Node

Return Type

Merkle hash.

Bytes.Bytes