Show / Hide Table of Contents

Class AccountDiff

Represents a difference between two IAccountStates. This is a partial interpretation of a raw difference obtained by Diff(ITrie) from IAccountState's perspective. Keep in mind of the following properties:

  • Any value, which is equivalent to non-existent value in the underlying storage, in the source is ignored. That is, even if the value in the target and the value in the source are different while the value in the source is null, this will not be part of the resulting AccountDiff.
  • This only shows the difference in "states" manipulated using SetState(Address, IValue) and RemoveState(Address). That is, this does care about differences in FungibleAssetValues.
  • Due to the reason mentioned directly above, the size of AccountDiff derived from Diff(ITrie) may not be the same. Moreover, an AccountDiff being empty does not guarantee that the data represented by IAccountStates are the same.
Inheritance
System.Object
AccountDiff
Namespace: Libplanet.Action.State
Assembly: Libplanet.Action.dll
Syntax
public class AccountDiff : object

Properties

| Improve this Doc View Source

StateDiffs

Represents a difference between two IAccountStates. This is a partial interpretation of a raw difference obtained by Diff(ITrie) from IAccountState's perspective. Keep in mind of the following properties:

  • Any value, which is equivalent to non-existent value in the underlying storage, in the source is ignored. That is, even if the value in the target and the value in the source are different while the value in the source is null, this will not be part of the resulting AccountDiff.
  • This only shows the difference in "states" manipulated using SetState(Address, IValue) and RemoveState(Address). That is, this does care about differences in FungibleAssetValues.
  • Due to the reason mentioned directly above, the size of AccountDiff derived from Diff(ITrie) may not be the same. Moreover, an AccountDiff being empty does not guarantee that the data represented by IAccountStates are the same.
Declaration
public ImmutableDictionary<Address, (IValue? , IValue)> StateDiffs { get; }
Property Value
Type Description
ImmutableDictionary<Address, System.ValueTuple<System.Nullable<IValue>, IValue>>

Methods

| Improve this Doc View Source

Create(IAccountState, IAccountState)

Creates an AccountDiff instance from given parameters.

Declaration
public static AccountDiff Create(IAccountState target, IAccountState source)
Parameters
Type Name Description
IAccountState target

The IAccountState to use as the target.

IAccountState source

The IAccountState to use as the source.

Returns
Type Description
AccountDiff

An AccountDiff created from given parameters.

Remarks

Note that the ordering of the parameters are flipped compared to Diff(ITrie) for syntactical reasons.

See Also
Diff(ITrie)
Create(ITrie, ITrie)
| Improve this Doc View Source

Create(ITrie, ITrie)

Creates an AccountDiff instance from given parameters.

Declaration
public static AccountDiff Create(ITrie target, ITrie source)
Parameters
Type Name Description
ITrie target

The ITrie to use as the target.

ITrie source

The ITrie to use as the source.

Returns
Type Description
AccountDiff

An AccountDiff created from given parameters.

Remarks

Note that the ordering of the parameters are flipped compared to Diff(ITrie) for syntactical reasons.

See Also
Diff(ITrie)
Create(IAccountState, IAccountState)
  • Improve this Doc
  • View Source
In This Article
Back to top Copyright © 2018–2023 Planetarium