MerkleTrieStateDiff

org.sigilaris.core.merkle.MerkleTrieStateDiff$package.MerkleTrieStateDiff

Companion object for MerkleTrieStateDiff with operations.

Attributes

Source
MerkleTrieStateDiff.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

Creates a diff from a map.

Creates a diff from a map.

Value parameters

map

the underlying map

Attributes

Returns

new diff

Source
MerkleTrieStateDiff.scala

Creates an empty diff.

Creates an empty diff.

Attributes

Source
MerkleTrieStateDiff.scala

Extensions

Extensions

extension (diff: MerkleTrieStateDiff)

Adds a node reference to the diff.

Adds a node reference to the diff.

Increments the reference count, or cancels out a -1 count.

Value parameters

hash

the node hash

node

the node

Attributes

Returns

updated diff

Source
MerkleTrieStateDiff.scala
def foreach(f: (MerkleHash, MerkleTrieNode) => Unit): Unit

Applies a function to all nodes with positive reference count.

Applies a function to all nodes with positive reference count.

Value parameters

f

function to apply to each (hash, node) pair

Attributes

Source
MerkleTrieStateDiff.scala
def get(hash: MerkleHash): Option[MerkleTrieNode]

Gets a node if it exists with positive reference count.

Gets a node if it exists with positive reference count.

Value parameters

hash

the node hash

Attributes

Returns

Some(node) if present with positive count, None otherwise

Source
MerkleTrieStateDiff.scala

Removes a node reference from the diff.

Removes a node reference from the diff.

Decrements the reference count, or cancels out a +1 count.

Value parameters

hash

the node hash

node

the node

Attributes

Returns

updated diff

Source
MerkleTrieStateDiff.scala
def string: String

Converts diff to string for debugging.

Converts diff to string for debugging.

Attributes

Source
MerkleTrieStateDiff.scala
def toList: List[(MerkleHash, (MerkleTrieNode, Int))]

Converts diff to list.

Converts diff to list.

Attributes

Source
MerkleTrieStateDiff.scala
def toMap: Map[MerkleHash, (MerkleTrieNode, Int)]

Converts diff to map.

Converts diff to map.

Attributes

Source
MerkleTrieStateDiff.scala