Interface ITrie
An interface for Merkle Tree.
Namespace: Libplanet.Store.Trie
Assembly: Libplanet.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> |
Recorded
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.
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. |
Get(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<Nullable<IValue>> | The values associated to the specified |
Set(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 |
IValue | value | The value to store. |
Returns
Type | Description |
---|---|
ITrie | Returns new updated ITrie. |