Interface ITrie
An interface for Merkle Tree.
Namespace: Libplanet.Store.Trie
Assembly: Libplanet.Store.dll
Syntax
public interface ITrie
Properties
| Improve this Doc View SourceHash
The state root hash of the trie.
Declaration
HashDigest<SHA256> Hash { get; }
Property Value
| Type | Description |
|---|---|
| HashDigest<SHA256> |
See Also
| Improve this Doc View SourceRecorded
Whether the trie root is recorded in the store.
Declaration
bool Recorded { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
Remarks
Empty root is considered as recorded.
See Also
Methods
| Improve this Doc View SourceCommit()
Cleans up and stores the ITrie in storage.
Declaration
ITrie Commit()
Returns
| Type | Description |
|---|---|
| ITrie | Returns new committed ITrie. |
See Also
| Improve this Doc View SourceGet(KeyBytes)
Gets the values stored with key in Set(in KeyBytes, IValue).
Declaration
IValue Get(KeyBytes key)
Parameters
| Type | Name | Description |
|---|---|---|
| KeyBytes | key | The key used in Set(in KeyBytes, IValue) to store a value. |
Returns
| Type | Description |
|---|---|
| Bencodex.Types.IValue | The value associated to the specified |
See Also
| Improve this Doc View SourceGet(IReadOnlyList<KeyBytes>)
Gets the values stored with keys in Set(in KeyBytes, IValue).
Declaration
IReadOnlyList<IValue> Get(IReadOnlyList<KeyBytes> keys)
Parameters
| Type | Name | Description |
|---|---|---|
| IReadOnlyList<KeyBytes> | keys | The keys used in Set(in KeyBytes, IValue) to store a value. |
Returns
| Type | Description |
|---|---|
| IReadOnlyList<Bencodex.Types.IValue> | The values associated to the specified |
See Also
| Improve this Doc View SourceSet(in KeyBytes, IValue)
Stores the value to the
node corresponding to given key.
Declaration
ITrie Set(in KeyBytes key, IValue value)
Parameters
| Type | Name | Description |
|---|---|---|
| KeyBytes | key | The unique key to associate with the |
| Bencodex.Types.IValue | value | The value to store. |
Returns
| Type | Description |
|---|---|
| ITrie | Returns new updated ITrie. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown when the given
|