Show / Hide Table of Contents

Interface IActionContext

Contextual data determined by a transaction and a block. Passed to Execute(IActionContext) method.

Namespace: Libplanet.Action
Assembly: Libplanet.Action.dll
Syntax
public interface IActionContext

Properties

| Improve this Doc View Source

BlockIndex

The Index of the Block that contains the IAction.

Declaration
long BlockIndex { get; }
Property Value
Type Description
System.Int64
| Improve this Doc View Source

BlockProtocolVersion

The ProtocolVersion of the Block that contains the IAction.

Declaration
int BlockProtocolVersion { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

Evidence

A list of EvidenceBases that are included in a Block.

Declaration
IReadOnlyList<EvidenceBase> Evidence { get; }
Property Value
Type Description
IReadOnlyList<EvidenceBase>
| Improve this Doc View Source

IsPolicyAction

Whether this action is executed as a policy action. false if it is a user action.

Declaration
bool IsPolicyAction { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

LastCommit

The BlockCommit about previous Block's vote information. null if the block is the genesis block.

Declaration
BlockCommit LastCommit { get; }
Property Value
Type Description
BlockCommit
| Improve this Doc View Source

MaxGasPrice

Max gas price set by the transaction. null if the action does not belongs to a transaction.

Declaration
FungibleAssetValue? MaxGasPrice { get; }
Property Value
Type Description
System.Nullable<FungibleAssetValue>
| Improve this Doc View Source

Miner

The Miner of the Block that contains the IAction.

Declaration
Address Miner { get; }
Property Value
Type Description
Address
| Improve this Doc View Source

PreviousState

A null delta of states, which means it represents the states before IAction executes.

Although a IAccount instance is immutable, it has several manipulative methods that returns new IAccount instances with some "dirty" states. These kinds of dirty IWorld instances can be returned by Execute(IActionContext) method.

Declaration
IWorld PreviousState { get; }
Property Value
Type Description
IWorld
| Improve this Doc View Source

RandomSeed

The random seed to use for pseudorandom number generator. This value is determined by various block properties, the signature of the transaction containing the action to execute, and index of the action to execute, which is deterministic so that every node can replay the same action and then reproduce the same result, while neither a single block miner nor a single transaction signer can predict the result and cheat.

Declaration
int RandomSeed { get; }
Property Value
Type Description
System.Int32
See Also
GetRandom()
| Improve this Doc View Source

Signer

The Signer of the Transaction that contains the IAction to be executed. If the IAction is not part of a Transaction, e.g. , this is set to Miner instead.

Declaration
Address Signer { get; }
Property Value
Type Description
Address
| Improve this Doc View Source

TxId

The Id of the Transaction that contains the IAction. If the IAction is not part of a Transaction, e.g. , this is set to null.

Declaration
TxId? TxId { get; }
Property Value
Type Description
System.Nullable<TxId>
| Improve this Doc View Source

Txs

A list of ITransactions that are included in a Block as the IAction to be evaluated. This information is provided only if IsPolicyAction is true, otherwise returns an empty set.

Declaration
IReadOnlyList<ITransaction> Txs { get; }
Property Value
Type Description
IReadOnlyList<ITransaction>

Methods

| Improve this Doc View Source

GetRandom()

Returns a newly initialized IRandom using RandomSeed as its seed value.

Declaration
IRandom GetRandom()
Returns
Type Description
IRandom

A newly initialized IRandom using RandomSeed as its seed value.

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