Show / Hide Table of Contents

Interface IAccount

An interface to manipulate an account state with maintaining .

It is like a map which is virtually initialized such that every possible Address exists and is mapped to null. That means that:

  • it does not have length,
  • its index getter never throws , but returns null instead, and
  • filling an Address with null state cannot be distinguished from the Address having never been set to any state.
Inherited Members
IAccountState.Trie
IAccountState.GetState(Address)
IAccountState.GetStates(IReadOnlyList<Address>)
Namespace: Libplanet.Action.State
Assembly: Libplanet.Action.dll
Syntax
public interface IAccount : IAccountState
Remarks

This interface is immutable. SetState(Address, IValue) method does not manipulate the instance, but returns a new IAccount instance with updated states.

Methods

| Improve this Doc View Source

RemoveState(Address)

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

Declaration
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 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
IAccount SetState(Address address, IValue state)
Parameters
Type Name Description
Address address

The Address referring the account to set its state.

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 does not manipulate the instance, but returns a new IAccount instance with updated states instead.

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