Class MerkleTrieExtensions
An extension class to provide some convenient methods to deal with MerkleTrie.
Inherited Members
Namespace: Libplanet.Store.Trie
Assembly: Libplanet.dll
Syntax
public static class MerkleTrieExtensions
Methods
| Improve this Doc View SourceDifferentNodes(MerkleTrie, MerkleTrie)
Compares two given tries and gets different value nodes (leaf node).
Declaration
public static IEnumerable<(KeyBytes Key, IValue OriginValue, IValue OtherValue)> DifferentNodes(this MerkleTrie origin, MerkleTrie other)
Parameters
Type | Name | Description |
---|---|---|
MerkleTrie | origin | A trie to compare. |
MerkleTrie | other | An other trie to compare. |
Returns
Type | Description |
---|---|
IEnumerable<(T1 Item1, T2 Item2, T3 Item3)<KeyBytes, Bencodex.Types.IValue, Bencodex.Types.IValue>> | Tuple<T1,T2,T3>s consists of different nodes.
The first element is different values' key.
The second element is the value at the given |
ListAllStates(MerkleTrie)
Lists the all states key and the all states in the given merkleTrie
.
Declaration
public static IEnumerable<KeyValuePair<KeyBytes, IValue>> ListAllStates(this MerkleTrie merkleTrie)
Parameters
Type | Name | Description |
---|---|---|
MerkleTrie | merkleTrie | A trie to discover. |
Returns
Type | Description |
---|---|
IEnumerable<KeyValuePair<KeyBytes, Bencodex.Types.IValue>> | All state keys and the all states. |