Show / Hide Table of Contents

Class WorldBaseState

A default implementation of IWorldState interface. It acts as root state of World recursion.

Inheritance
System.Object
WorldBaseState
Implements
IWorldState
Namespace: Libplanet.Action.State
Assembly: Libplanet.Action.dll
Syntax
public class WorldBaseState : object, IWorldState

Constructors

| Improve this Doc View Source

WorldBaseState(ITrie, IStateStore)

A default implementation of IWorldState interface. It acts as root state of World recursion.

Declaration
public WorldBaseState(ITrie trie, IStateStore stateStore)
Parameters
Type Name Description
ITrie trie
IStateStore stateStore

Properties

| Improve this Doc View Source

Legacy

Whether IWorldState is backed by an ITrie with the legacy data model. This is true if and only if Version is less than WorldStateProtocolVersion.

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

Trie

The ITrie of the IWorldState.

Declaration
public ITrie Trie { get; }
Property Value
Type Description
ITrie
| Improve this Doc View Source

Version

The version of the backend ITrie data model. This should be in sync with ProtocolVersion of the IPreEvaluationBlock getting evaluated. As this was only introduced since WorldStateProtocolVersion, this returns zero with any ITrie representing an IWorldState before WorldStateProtocolVersion or any ITrie representing an IAccountState.

Declaration
public int Version { get; }
Property Value
Type Description
System.Int32
See Also
Version

Methods

| Improve this Doc View Source

GetAccountState(Address)

Gets the IAccountState of the given address.

Declaration
public IAccountState GetAccountState(Address address)
Parameters
Type Name Description
Address address

The Address referring the world to get its state.

Returns
Type Description
IAccountState

The IAccountState of the given address. If it has never been set to any state it returns null instead.

Implements

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