Show / Hide Table of Contents

Class BlockChainStates

A default implementation of IBlockChainStates interface.

Inheritance
Object
BlockChainStates
Implements
IBlockChainStates
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: Libplanet.Blockchain
Assembly: Libplanet.dll
Syntax
public class BlockChainStates : IBlockChainStates

Constructors

| Improve this Doc View Source

BlockChainStates(IStore, IStateStore)

A default implementation of IBlockChainStates interface.

Declaration
public BlockChainStates(IStore store, IStateStore stateStore)
Parameters
Type Name Description
IStore store
IStateStore stateStore

Methods

| Improve this Doc View Source

GetBalance(Address, Currency, BlockHash)

Queries address's balance of the currency in the BlockChain<T> from offset.

Declaration
public FungibleAssetValue GetBalance(Address address, Currency currency, BlockHash offset)
Parameters
Type Name Description
Address address

The owner Address to query.

Currency currency

The currency type to query.

BlockHash offset

The HashDigest<T> of the block to start finding the state.

Returns
Type Description
FungibleAssetValue

The address's current balance (or balance as of the given offset) of the currency.

| Improve this Doc View Source

GetStates(IReadOnlyList<Address>, BlockHash)

Gets multiple states associated to the specified addresses.

Declaration
public IReadOnlyList<IValue> GetStates(IReadOnlyList<Address> addresses, BlockHash offset)
Parameters
Type Name Description
IReadOnlyList<Address> addresses

Addresses of states to query.

BlockHash offset

The HashDigest<T> of the block to start finding the states.

Returns
Type Description
IReadOnlyList<Bencodex.Types.IValue>

The states associated to the specified addresses. Associated values are ordered in the same way to the corresponding addresses. Absent states are represented as null.

| Improve this Doc View Source

GetTotalSupply(Currency, BlockHash)

Gets the total supply of a currency in the BlockChain<T> from offset, and if not found, return 0.

Declaration
public FungibleAssetValue GetTotalSupply(Currency currency, BlockHash offset)
Parameters
Type Name Description
Currency currency

The currency type to query.

BlockHash offset

The HashDigest<T> of the block to start finding the state.

Returns
Type Description
FungibleAssetValue

The total supply value of currency at offset in FungibleAssetValue.

| Improve this Doc View Source

GetTrie(BlockHash)

Returns the state trie for offset.

Declaration
public ITrie GetTrie(BlockHash offset)
Parameters
Type Name Description
BlockHash offset

The HashDigest<T> of the block to start finding the state.

Returns
Type Description
ITrie

The merkle trie instance for given offset.

| Improve this Doc View Source

GetValidatorSet(BlockHash)

Returns the validator set in the BlockChain<T> from offset.

Declaration
public ValidatorSet GetValidatorSet(BlockHash offset)
Parameters
Type Name Description
BlockHash offset

The HashDigest<T> of the block to start finding the state.

Returns
Type Description
ValidatorSet

The validator set of type ValidatorSet at the offset.

Implements

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