Class ValidatingActionRenderer
Validates if rendering events are in the correct order according to the documented automata (see also the docs for IRenderer and IActionRenderer) using profiling-guided analysis.
Inherited Members
Namespace: Libplanet.Blockchain.Renderers.Debug
Assembly: Libplanet.dll
Syntax
public class ValidatingActionRenderer : RecordingActionRenderer, IActionRenderer, IRenderer
Constructors
| Improve this Doc View SourceValidatingActionRenderer(Action<InvalidRenderException>)
Creates a new ValidatingActionRenderer instance.
Declaration
public ValidatingActionRenderer(Action<InvalidRenderException> onError = null)
Parameters
Type | Name | Description |
---|---|---|
Action<InvalidRenderException> | onError | An optional event handler which is triggered when invalid render events occur. |
Methods
| Improve this Doc View SourceRenderAction(IValue, ICommittedActionContext, HashDigest<SHA256>)
Does things that should be done right after an action
is executed and applied to the blockchain.
Declaration
public override void RenderAction(IValue action, ICommittedActionContext context, HashDigest<SHA256> nextState)
Parameters
Type | Name | Description |
---|---|---|
Bencodex.Types.IValue | action | An executed action. |
ICommittedActionContext | context | The equivalent context object to an object passed to
the |
HashDigest<SHA256> | nextState | The state root hash right after this action executed,
which means it is equivalent to the states |
Overrides
Remarks
It is guaranteed to be called only once for an action
,
and only after applied to the blockchain, unless an exception is thrown during executing
the action
(in that case RenderActionError(IValue, ICommittedActionContext, Exception) is called instead) or
once the action
has been unrendered.
Also note that this method is invoked after RenderBlock(Block, Block) method is called
(where its second parameter newTip
contains a transaction the action
belongs to).
RenderActionError(IValue, ICommittedActionContext, Exception)
Does the similar things to RenderAction(IValue, ICommittedActionContext, HashDigest<SHA256>), except that this method
is invoked when action
has terminated with an exception.
Declaration
public override void RenderActionError(IValue action, ICommittedActionContext context, Exception exception)
Parameters
Type | Name | Description |
---|---|---|
Bencodex.Types.IValue | action | An action which threw an exception during execution. |
ICommittedActionContext | context | The equivalent context object to an object passed to
the |
Exception | exception | The exception thrown during executing the |
Overrides
Remarks
Also note that this method is invoked after RenderBlock(Block, Block) method is called
(where its second parameter newTip
contains a transaction the action
belongs to).
RenderBlock(Block, Block)
Does things that should be done right after a new Block is appended to a BlockChain (so that its Tip has changed).
Declaration
public override void RenderBlock(Block oldTip, Block newTip)
Parameters
Type | Name | Description |
---|---|---|
Block | oldTip | The previous Tip. |
Block | newTip | The current Tip. |
Overrides
Remarks
It is guaranteed to be called only once for a block, and only after applied to the blockchain, unless it has been stale due to reorg.
RenderBlockEnd(Block, Block)
Does things that should be done right all actions in a new Block are rendered.
Declaration
public override void RenderBlockEnd(Block oldTip, Block newTip)
Parameters
Type | Name | Description |
---|---|---|
Block | oldTip | The previous Tip. |
Block | newTip | The current Tip. |
Overrides
Remarks
It is guaranteed to be called only once for a block.