Class StoreExtension
Inherited Members
Namespace: Libplanet.Store
Assembly: Libplanet.dll
Syntax
public static class StoreExtension
Methods
| Improve this Doc View SourceListAllStateReferences(IStore, String, Nullable<HashDigest<SHA256>>, Nullable<HashDigest<SHA256>>)
Lists all accounts, that have any states, in the given namespace
and
their state references.
Declaration
public static IImmutableDictionary<Address, IImmutableList<HashDigest<SHA256>>> ListAllStateReferences(this IStore store, string namespace, HashDigest<SHA256>? onlyAfter = default(HashDigest<SHA256>? ), HashDigest<SHA256>? ignoreAfter = default(HashDigest<SHA256>? ))
Parameters
Type | Name | Description |
---|---|---|
IStore | store | A store object. |
String | namespace | The namespace to look up state references. |
Nullable<HashDigest<SHA256>> | onlyAfter | Includes state references only made after the block this argument refers to, if present. |
Nullable<HashDigest<SHA256>> | ignoreAfter | Excludes state references made after the block this argument refers to, if present. |
Returns
Type | Description |
---|---|
IImmutableDictionary<Address, IImmutableList<HashDigest<SHA256>>> | A dictionary of account addresses to lists of their corresponding state references. Each list of state references is in ascending order, i.e., the block closest to the genesis goes first and the block closest to the tip goes last. |
LookupStateReference<T>(IStore, String, Address, Block<T>)
Looks up a state reference, which is a block's Hash that contains
an action mutating the address
' state.
Declaration
public static Tuple<HashDigest<SHA256>, long> LookupStateReference<T>(this IStore store, string namespace, Address address, Block<T> lookupUntil)
where T : IAction, new()
Parameters
Type | Name | Description |
---|---|---|
IStore | store | The store object expected to contain the state reference. |
String | namespace | The namespace to look up a state reference. |
Address | address | The Address to look up. |
Block<T> | lookupUntil | The upper bound (i.e., the latest block) of the search range.
Block<T>s after |
Returns
Type | Description |
---|---|
Tuple<HashDigest<SHA256>, Int64> | Returns a nullable tuple consisting of Hash and Index of the Block<T> with the state of the address. |
Type Parameters
Name | Description |
---|---|
T | An IAction class used with
|