Class ActionEvaluator<T>
Class responsible for handling of IAction evaluations.
Namespace: Libplanet.Action
Assembly: Libplanet.dll
Syntax
public class ActionEvaluator<T> : object where T : IAction, new()
Type Parameters
Name | Description |
---|---|
T | An IAction type. It should match the Block<T>'s type parameter. |
Constructors
| Improve this Doc View SourceActionEvaluator(IAction, IBlockChainStates<T>, Nullable<Func<BlockHash, ITrie>>)
Creates a new ActionEvaluator<T>.
Declaration
public ActionEvaluator(IAction policyBlockAction, IBlockChainStates<T> blockChainStates, Func<BlockHash, ITrie>? trieGetter)
Parameters
Type | Name | Description |
---|---|---|
IAction | policyBlockAction | The IAction provided by BlockAction to evaluate at the end for each Block<T> that gets evaluated. |
IBlockChainStates<T> | blockChainStates | The IBlockChainStates<T> to use to retrieve the states for a provided Address. |
Nullable<Func<BlockHash, ITrie>> | trieGetter | The function to retrieve a trie for a provided BlockHash. |
Methods
| Improve this Doc View SourceEvaluate(IPreEvaluationBlock<T>, StateCompleterSet<T>)
The main entry point for evaluating a Block<T>.
Declaration
public IReadOnlyList<ActionEvaluation> Evaluate(IPreEvaluationBlock<T> block, StateCompleterSet<T> stateCompleterSet)
Parameters
Type | Name | Description |
---|---|---|
IPreEvaluationBlock<T> | block | The block to evaluate. |
StateCompleterSet<T> | stateCompleterSet | The StateCompleterSet<T> to use. |
Returns
Type | Description |
---|---|
IReadOnlyList<ActionEvaluation> | The result of evaluating every IAction related to
|
Remarks
Publicly exposed for benchmarking.
First evaluates all IActions in Transactions
of block
and appends the evaluation of
the BlockAction held by the instance at the end.