Class BlockChainStates
A default implementation of IBlockChainStates interface.
Implements
Inherited Members
Namespace: Libplanet.Blockchain
Assembly: Libplanet.dll
Syntax
public class BlockChainStates : IBlockChainStates
Constructors
| Improve this Doc View SourceBlockChainStates(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 SourceGetBalance(Address, Currency, BlockHash)
Queries address
's balance of the currency
in the
BlockChain 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 |
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 |
GetTotalSupply(Currency, BlockHash)
Gets the total supply of a currency
in the
BlockChain 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 |
GetValidatorSet(BlockHash)
Returns the validator set in the
BlockChain 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
|