Class ActionEvaluator
Class responsible for handling of IAction evaluations.
Implements
Inherited Members
Namespace: Libplanet.Action
Assembly: Libplanet.Action.dll
Syntax
public class ActionEvaluator : IActionEvaluator
Constructors
| Improve this Doc View SourceActionEvaluator(PolicyBlockActionGetter, IStateStore, IActionLoader)
Creates a new ActionEvaluator.
Declaration
public ActionEvaluator(PolicyBlockActionGetter policyBlockActionGetter, IStateStore stateStore, IActionLoader actionTypeLoader)
Parameters
| Type | Name | Description |
|---|---|---|
| PolicyBlockActionGetter | policyBlockActionGetter | A delegator to get policy block action to evaluate at the end for each IPreEvaluationBlock that gets evaluated. |
| IStateStore | stateStore | The IStateStore to use to retrieve the states for a provided HashDigest<T>. |
| IActionLoader | actionTypeLoader | A IActionLoader implementation using action type lookup. |
Properties
| Improve this Doc View SourceActionLoader
The IActionLoader used by this IActionEvaluator when evaluating Blocks.
Declaration
[Pure]
public IActionLoader ActionLoader { get; }
Property Value
| Type | Description |
|---|---|
| IActionLoader |
Methods
| Improve this Doc View SourceEvaluate(IPreEvaluationBlock, Nullable<HashDigest<SHA256>>)
The main entry point for evaluating a IPreEvaluationBlock.
Declaration
[Pure]
public IReadOnlyList<ICommittedActionEvaluation> Evaluate(IPreEvaluationBlock block, HashDigest<SHA256>? baseStateRootHash)
Parameters
| Type | Name | Description |
|---|---|---|
| IPreEvaluationBlock | block | The block to evaluate. |
| Nullable<HashDigest<SHA256>> | baseStateRootHash | The base state to use when evaluating
|
Returns
| Type | Description |
|---|---|
| IReadOnlyList<ICommittedActionEvaluation> | The result of evaluating every IAction related to
|
Remarks
This has a side-effect of writing data to internally held IStateStore.
First evaluates all IActions in
Transactions of block and appends the
evaluation of the
GenerateRandomSeed(Byte[], Byte[], Byte[], Int32)
Creates a random seed.
Declaration
[Pure]
public static int GenerateRandomSeed(byte[] preEvaluationHashBytes, byte[] hashedSignature, byte[] signature, int actionOffset)
Parameters
| Type | Name | Description |
|---|---|---|
| Byte[] | preEvaluationHashBytes | The previous evaluation hash turned into bytes. |
| Byte[] | hashedSignature | The hashed signature. |
| Byte[] | signature | The signature. |
| Int32 | actionOffset | The offset of the action. |
Returns
| Type | Description |
|---|---|
| Int32 | An integer of the random seed. |