Interface IAccountStateDelta
An interface to manipulate account states with maintaining the set of UpdatedAddresses.
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
KeyNotFoundException,
but returns
nullinstead, and - filling an Address with
nullstate cannot be distinguished from the Address having never been set to any state.
Namespace: Libplanet.Action
Assembly: Libplanet.dll
Syntax
public interface IAccountStateDelta
Remarks
This interface is immutable. SetState(Address, Object) method does not manipulate the instance, but returns a new IAccountStateDelta instance with updated states.
Properties
| Improve this Doc View SourceUpdatedAddresses
Addresses of the accounts that have been updated since then.
Declaration
[Pure]
IImmutableSet<Address> UpdatedAddresses { get; }
Property Value
| Type | Description |
|---|---|
| IImmutableSet<Address> |
Methods
| Improve this Doc View SourceGetState(Address)
Gets the account state of the given address.
Declaration
[Pure]
object GetState(Address address)
Parameters
| Type | Name | Description |
|---|---|---|
| Address | address | The Address referring the account to get its state. |
Returns
| Type | Description |
|---|---|
| Object | The account state of the given |
SetState(Address, Object)
Gets a new instance that the account state of the given
address is set to the given
state.
Declaration
[Pure]
IAccountStateDelta SetState(Address address, object state)
Parameters
| Type | Name | Description |
|---|---|---|
| Address | address | The Address referring the account to set its state. |
| Object | state | The new state to fill the account with. |
Returns
| Type | Description |
|---|---|
| IAccountStateDelta | A new IAccountStateDelta instance that
the account state of the given |
Remarks
This method method does not manipulate the instance, but returns a new IAccountStateDelta instance with updated states instead.