Show / Hide Table of Contents

Class ActionEvaluator<T>

Class responsible for handling of IAction evaluations.

Inheritance
Object
ActionEvaluator<T>
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: Libplanet.Action
Assembly: Libplanet.dll
Syntax
public class ActionEvaluator<T>
    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 Source

ActionEvaluator(HashAlgorithmGetter, IAction, StateGetter<T>, BalanceGetter<T>, Func<BlockHash, ITrie>)

Creates a new ActionEvaluator<T>.

Declaration
public ActionEvaluator(HashAlgorithmGetter hashAlgorithmGetter, IAction policyBlockAction, StateGetter<T> stateGetter, BalanceGetter<T> balanceGetter, Func<BlockHash, ITrie> trieGetter)
Parameters
Type Name Description
HashAlgorithmGetter hashAlgorithmGetter

The function to determine a hash algorithm to use for a block index.

IAction policyBlockAction

The IAction provided by BlockAction to evaluate at the end for each Block<T> that gets evaluated.

StateGetter<T> stateGetter

The StateGetter<T> to use to retreive the states for a provided Address.

BalanceGetter<T> balanceGetter

The BalanceGetter<T> to use to retreive the balance for a provided Address.

Func<BlockHash, ITrie> trieGetter

The function to retrieve a trie for a provided BlockHash.

Methods

| Improve this Doc View Source

Evaluate(IPreEvaluationBlock<T>, StateCompleterSet<T>)

The main entry point for evaluating a Block<T>.

Declaration
[Pure]
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 block as an IReadOnlyList<T> of ActionEvaluations.

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.

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