Show / Hide Table of Contents

Interface ITrie

An interface for Merkle Tree.

Namespace: Libplanet.Store.Trie
Assembly: Libplanet.dll
Syntax
public interface ITrie

Properties

| Improve this Doc View Source

Hash

The state root hash of the trie.

Declaration
HashDigest<SHA256> Hash { get; }
Property Value
Type Description
HashDigest<SHA256>
| Improve this Doc View Source

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 Source

Commit()

Cleans up and stores the ITrie in storage.

Declaration
ITrie Commit()
Returns
Type Description
ITrie

Returns new committed ITrie.

| Improve this Doc View Source

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 keys. The associated values are ordered in the same way to the corresponding keys. Absent values are represented as null.

| Improve this Doc View Source

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 value.

IValue value

The value to store.

Returns
Type Description
ITrie

Returns new updated ITrie.

See Also

MerkleTrie
  • Improve this Doc
  • View Source
In This Article
Back to top Copyright © 2018–2022 Planetarium