• Design
  • API Reference
  • Changelog
  • Contribute
Show / Hide Table of Contents
  • Libplanet
    • Address
    • AddressExtension
    • BencodexExtension
    • ByteUtil
    • Hashcash
    • Hashcash.Stamp
    • HashDigest<T>
    • HashDigestExtension
    • Nonce
  • Libplanet.Action
    • AccountStateGetter
    • ActionEvaluation
    • ActionTypeAttribute
    • AddressStateMap
    • IAccountStateDelta
    • IAction
    • IActionContext
    • IRandom
    • MissingActionTypeException
    • PolymorphicAction<T>
    • RandomExtension
    • UnexpectedlyTerminatedActionException
  • Libplanet.Blockchain
    • BlockChain<T>
    • BlockChain<T>.TipChangedEventArgs
    • IncompleteBlockStatesException
    • MineBlockEventArgs<T>
  • Libplanet.Blockchain.Policies
    • BlockPolicy<T>
    • IBlockPolicy<T>
  • Libplanet.Blocks
    • Block<T>
    • InvalidBlockDifficultyException
    • InvalidBlockException
    • InvalidBlockHashException
    • InvalidBlockIndexException
    • InvalidBlockNonceException
    • InvalidBlockPreviousHashException
    • InvalidBlockTimestampException
  • Libplanet.Crypto
    • InvalidCiphertextException
    • PrivateKey
    • PublicKey
    • SymmetricKey
  • Libplanet.KeyStore
    • IncorrectPassphraseException
    • InvalidKeyJsonException
    • KeyJsonException
    • MismatchedAddressException
    • ProtectedPrivateKey
    • UnsupportedKeyJsonException
  • Libplanet.KeyStore.Ciphers
    • Aes128Ctr
    • ICipher
  • Libplanet.KeyStore.Kdfs
    • IKdf
    • Pbkdf2<T>
    • Scrypt
  • Libplanet.Net
    • ActionExecutionState
    • BlockDownloadState
    • BlockStateDownloadState
    • BoundPeer
    • DifferentAppProtocolVersionException
    • DifferentProtocolVersionEventArgs
    • IceServer
    • IceServerException
    • InvalidMessageException
    • NoSwarmContextException
    • Peer
    • PeerNotFoundException
    • PreloadState
    • StateReferenceDownloadState
    • Swarm<T>
    • SwarmException
  • Libplanet.Serialization
    • BencodexFormatter<T>
    • SerializationInfoExtension
  • Libplanet.Store
    • BaseIndex<TKey, TVal>
    • BaseStore
    • BlockSet<T>
    • ChainIdNotFoundException
    • IStore
    • LiteDBStore
    • StoreExtension
    • TransactionSet<T>
  • Libplanet.Tx
    • InvalidTxException
    • InvalidTxIdException
    • InvalidTxNonceException
    • InvalidTxPublicKeyException
    • InvalidTxSignatureException
    • InvalidTxUpdatedAddressesException
    • Transaction<T>
    • TxId

Class StoreExtension

Inheritance
Object
StoreExtension
Namespace: Libplanet.Store
Assembly: Libplanet.dll
Syntax
public static class StoreExtension : object

Methods

| Improve this Doc View Source

ListAllStateReferences(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.

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.

| Improve this Doc View Source

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 lookupUntil are ignored.

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

See Also
StoreStateReference(Guid, IImmutableSet<Address>, HashDigest<SHA256>, Int64)
IterateStateReferences(Guid, Address, Nullable<Int64>, Nullable<Int64>, Nullable<Int32>)
  • Improve this Doc
  • View Source
Back to top Copyright © 2019 Planetarium
Generated by DocFX