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> |
Methods
| Improve this Doc View SourceCommit(Boolean)
Cleans up and stores the ITrie in storage.
Declaration
ITrie Commit(bool rehearsal = false)
Parameters
Type | Name | Description |
---|---|---|
Boolean | rehearsal | Whether to store nodes. |
Returns
Type | Description |
---|---|
ITrie | Returns new committed ITrie. |
Set(Byte[], IValue)
Stores the value
to the
node corresponding to given key
.
Declaration
ITrie Set(byte[] key, IValue value)
Parameters
Type | Name | Description |
---|---|---|
Byte[] | key | An index to look with TryGet(Byte[], out Nullable<IValue>) after. |
IValue | value | The value to store. |
Returns
Type | Description |
---|---|
ITrie | Returns new updated ITrie. |
TryGet(Byte[], out Nullable<IValue>)
Gets the value stored with key
in Set(Byte[], IValue).
Declaration
bool TryGet(byte[] key, out IValue? value)
Parameters
Type | Name | Description |
---|---|---|
Byte[] | key | The key used in Set(Byte[], IValue) to store a value. |
Nullable<IValue> | value | The reference pointer to be set the value stored. |
Returns
Type | Description |
---|---|
Boolean | If there is a value corresponded to |