Class StoreExtensions
Convenient extension methods for IStore.
Inherited Members
Namespace: Libplanet.Store
Assembly: Libplanet.Store.dll
Syntax
public static class StoreExtensions
Methods
| Improve this Doc View SourceCopy(IStore, IStore)
Makes a store, to
, logically (but not necessarily physically)
identical to another store, from
. As this copies the contents
of the store, instead of its physicall data, this can be used for migrating
between two different types of IStore implementations.
Declaration
public static void Copy(this IStore from, IStore to)
Parameters
Type | Name | Description |
---|---|---|
IStore | from | The store containing the source contents. |
IStore | to | The store to contain the copied contents. Expected to be empty. |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown when the store passed through
|
GetStateRootHash(IStore, Nullable<BlockHash>)
Gets the StateRootHash of the given blockHash
.
Declaration
public static HashDigest<SHA256>? GetStateRootHash(this IStore store, BlockHash? blockHash)
Parameters
Type | Name | Description |
---|---|---|
IStore | store | The store that blocks are stored. |
Nullable<BlockHash> | blockHash | The hash of the block to get the state root hash of. This can be null. |
Returns
Type | Description |
---|---|
Nullable<HashDigest<SHA256>> | The state root hash of the block associated with |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown when |