Something went wrong. Try again.
An Elixir implementation of AT Protocol-flavoured Merkle Search Trees (MST)
Something went wrong. Try again.
512 B · 20 lines
Elixir
at main
123456789101112131415161718192021defmodule MST.Node.Entry do @moduledoc """ A single entry within an `MST.Node`.
Stores a compressed key (`prefix_len` bytes shared with the previous entry's full key, plus `key_suffix`), the CID of the value record (`value`), and an optional CID pointing to a right subtree (`right`). """
use TypedStruct
alias DASL.CID
typedstruct enforce: true do field :prefix_len, non_neg_integer() field :key_suffix, binary() field :value, CID.t() field :right, CID.t() | nil endend