Show / Hide Table of Contents

Class Account

An internal implementation of IAccount.

Inheritance
Object
Account
Implements
IAccount
IAccountState
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: Libplanet.Action.State
Assembly: Libplanet.Action.dll
Syntax
[Pure]
public class Account : IAccount, IAccountState

Constructors

| Improve this Doc View Source

Account(IAccountState)

An internal implementation of IAccount.

Declaration
public Account(IAccountState state)
Parameters
Type Name Description
IAccountState state

Properties

| Improve this Doc View Source

Trie

The ITrie of the IAccountState.

Declaration
public ITrie Trie { get; }
Property Value
Type Description
ITrie

Methods

| Improve this Doc View Source

GetState(Address)

Gets the account state of the given address.

Declaration
[Pure]
public IValue GetState(Address address)
Parameters
Type Name Description
Address address

The Address referring the account to get its state.

Returns
Type Description
Bencodex.Types.IValue

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

| Improve this Doc View Source

GetStates(IReadOnlyList<Address>)

Gets multiple account states associated with the specified addresses at once.

Declaration
[Pure]
public IReadOnlyList<IValue> GetStates(IReadOnlyList<Address> addresses)
Parameters
Type Name Description
IReadOnlyList<Address> addresses

The Addresses associated with states to get.

Returns
Type Description
IReadOnlyList<Bencodex.Types.IValue>

The states associated to the specified addresses. Associated values are ordered in the same way to the corresponding addresses. Absent states are represented as null.

| Improve this Doc View Source

RemoveState(Address)

Gets a new instance that the account state of the given address is removed.

Declaration
[Pure]
public IAccount RemoveState(Address address)
Parameters
Type Name Description
Address address

The Address referring the account to remove its state.

Returns
Type Description
IAccount

A new IAccount instance that the account state of the given address is removed.

Remarks

This method method does not manipulate the instance, but returns a new IAccount instance with updated states instead.

| Improve this Doc View Source

SetState(Address, IValue)

Gets a new instance that the account state of the given address is set to the given state.

Declaration
[Pure]
public IAccount SetState(Address address, IValue state)
Parameters
Type Name Description
Address address

The Address referring the account to set its state.

Bencodex.Types.IValue state

The new state to fill the account with.

Returns
Type Description
IAccount

A new IAccount instance that the account state of the given address is set to the given state.

Remarks

This method method does not manipulate the instance, but returns a new IAccount instance with updated states instead.

Implements

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