Class ActionEvaluator
Class responsible for handling of IAction evaluations.
Inheritance
Implements
Namespace: Libplanet.Action
Assembly: Libplanet.Action.dll
Syntax
public class ActionEvaluator : object, IActionEvaluator
Constructors
| Improve this Doc View SourceActionEvaluator(PolicyActionsRegistry, IStateStore, IActionLoader)
Creates a new Action
Declaration
public ActionEvaluator(PolicyActionsRegistry policyActionsRegistry, IStateStore stateStore, IActionLoader actionTypeLoader)
Parameters
Type | Name | Description |
---|---|---|
Policy |
policyActionsRegistry | A Policy |
IState |
stateStore | The IState |
IAction |
actionTypeLoader | A IAction |
Properties
| Improve this Doc View SourceActionLoader
The IAction
Declaration
public IActionLoader ActionLoader { get; }
Property Value
Type | Description |
---|---|
IAction |
Methods
| Improve this Doc View SourceEvaluate(IPreEvaluationBlock, Nullable<HashDigest<SHA256>>)
The main entry point for evaluating a IPre
Declaration
public IReadOnlyList<ICommittedActionEvaluation> Evaluate(IPreEvaluationBlock block, HashDigest<SHA256>? baseStateRootHash)
Parameters
Type | Name | Description |
---|---|---|
IPre |
block | The block to evaluate. |
System. |
baseStateRootHash | The base state to use when evaluating
|
Returns
Type | Description |
---|---|
IRead |
The result of evaluating every IAction related to
|
Remarks
This has a side-effect of writing data to internally held IState
First evaluates all IActions in
Transactions of block
and appends the
evaluation of the
Exceptions
Type | Condition |
---|---|
Block |
Thrown when
|
GenerateRandomSeed(Byte[], Byte[], Int32)
Creates a random seed.
Declaration
public static int GenerateRandomSeed(byte[] preEvaluationHashBytes, byte[] signature, int actionOffset)
Parameters
Type | Name | Description |
---|---|---|
System. |
preEvaluationHashBytes | The pre-evaluation hash as bytes. |
System. |
signature | The signature of the Transaction the target IAction belongs to. Must be empty if the target IAction is a block action. |
System. |
actionOffset | The offset of the target IAction. |
Returns
Type | Description |
---|---|
System. |
An integer of the random seed. |