Serializable
, Comparable<AccountEpoch>
public enum AccountEpoch extends Enum<AccountEpoch>
Enum Constant | Description |
---|---|
V1 |
Version 1 epoch block, which marks the transition from legacy blocks (send/receive/open/change) to UTX state
blocks.
|
V2 |
Version 2 epoch block, which marks the change in minimum work difficulties introduced in node V21.
|
Modifier and Type | Field | Description |
---|---|---|
static AccountEpoch |
LATEST_EPOCH |
Modifier and Type | Method | Description |
---|---|---|
static AccountEpoch |
calculateAccountVersion(Collection<Block> blocks) |
Calculates the account version from a given set of blocks.
|
static AccountEpoch |
fromEpochBlock(Block block) |
Retrieves the corresponding
AccountEpoch from a given epoch block. |
static AccountEpoch |
fromIdentifier(String id) |
Returns the appropriate epoch transition from a given identifier.
|
static AccountEpoch |
fromVersion(int ver) |
Returns the appropriate epoch transition from a given version integer.
|
String |
getIdentifier() |
|
NanoAccount |
getSignerAccount() |
|
int |
getVersion() |
|
static AccountEpoch |
valueOf(String name) |
Returns the enum constant of this type with the specified name.
|
static AccountEpoch[] |
values() |
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final AccountEpoch V1
public static final AccountEpoch V2
public static final AccountEpoch LATEST_EPOCH
public static AccountEpoch[] values()
for (AccountEpoch c : AccountEpoch.values()) System.out.println(c);
public static AccountEpoch valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic int getVersion()
public String getIdentifier()
link
data) of this epoch upgradepublic NanoAccount getSignerAccount()
public static AccountEpoch fromVersion(int ver)
ver
- the version which the epoch block will upgrade the account topublic static AccountEpoch fromIdentifier(String id)
id
- the identifier of the epoch transition (link data value)public static AccountEpoch fromEpochBlock(Block block)
AccountEpoch
from a given epoch block. In cases where the given block is
not an epoch block, this method will return null.block
- the epoch blockpublic static AccountEpoch calculateAccountVersion(Collection<Block> blocks)
blocks
- a set of blocks within a certain accountCopyright © 2020. All rights reserved.