Class StoreExtension
Inheritance
Namespace: Libplanet.Store
Assembly: Libplanet.dll
Syntax
public static class StoreExtension : object
Methods
| Improve this Doc View SourceListAllStateReferences(IStore, Guid, Nullable<HashDigest<SHA256>>, Nullable<HashDigest<SHA256>>)
Lists all accounts, that have any states, in the given chainId
and
their state references.
Declaration
public static IImmutableDictionary<Address, IImmutableList<HashDigest<SHA256>>> ListAllStateReferences(this IStore store, Guid chainId, HashDigest<SHA256>? onlyAfter = null, HashDigest<SHA256>? ignoreAfter = null)
Parameters
Type | Name | Description |
---|---|---|
IStore | store | A store object. |
Guid | chainId | The chain ID to look up state references. |
System.Nullable<HashDigest<SHA256>> | onlyAfter | Includes state references only made after the block this argument refers to, if present. |
System.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, Guid, 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, Guid chainId, Address address, Block<T> lookupUntil)
where T : IAction, new()
Parameters
Type | Name | Description |
---|---|---|
IStore | store | The store object expected to contain the state reference. |
Guid | chainId | The chain ID 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>, System.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
|