Node

scalus.crypto.trie.Node
See theNode companion trait
object Node

Attributes

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Node.type

Members list

Type members

Classlikes

final class Branch(val skipStart: Int, val skipLen: Int, val repPath: ByteString, val children: Vector[Node], val size: Int, computeHash: () => ByteString) extends Node

A branch node with up to 16 children.

A branch node with up to 16 children.

Hash is computed lazily via the provided thunk, which calls the variant-specific branchHash. This avoids redundant blake2b_256 calls during bulk trie construction — intermediate branch hashes that get replaced on the next insert are never computed.

Value parameters

repPath

any descendant leaf's fullPath (shared reference, used to read nibble values)

skipLen

number of common prefix nibbles

skipStart

cursor position at creation

Attributes

Supertypes
trait Node
class Object
trait Matchable
class Any
case object Empty extends Node

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Node
class Object
trait Matchable
class Any
Show all
Self type
Empty.type
final class Leaf(val skipStart: Int, val fullPath: ByteString, val key: ByteString, val value: ByteString) extends Node

A leaf node that stores the value and the full key.

A leaf node that stores the value and the full key.

Hash is computed lazily — only when first accessed (e.g. for rootHash or proof generation). This avoids redundant blake2b_256 calls during bulk trie construction.

Value parameters

skipStart

cursor position at creation; nibbles are derived via nibbleAt(fullPath, skipStart + i)

Attributes

Supertypes
trait Node
class Object
trait Matchable
class Any