Package com.norswap.nanoeth.versions
Enum EthereumVersion
- All Implemented Interfaces:
Serializable
,Comparable<EthereumVersion>
,Constable
public enum EthereumVersion extends Enum<EthereumVersion>
Enumeration of Ethereum's "versions": the hard forks that were rolled out during the chain's
history.
Note that the CONSTANTINOPLE
fork also includes the St-Petersburg hard fork at the
same block height, which removes EIP-1283, which was only rolled out on the testnets.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants Enum Constant Description BERLIN
BYZANTIUM
CONSTANTINOPLE
DAO_FORK
FRONTIER
FRONTIER_THAWING
HOMESTEAD
ISTANBUL
LONDON
MUIR_GLACIER
PETERSBURG
SPURIOUS_DRAGON
TANGERINE_WHISTLE
-
Field Summary
Fields Modifier and Type Field Description int
startBlock
Block height where the fork took effect. -
Method Summary
Modifier and Type Method Description boolean
contains(int blockHeight)
Returns true iff the given block height is "within" this version: after or on its start block, but before the start block of the next version.boolean
contains(Natural blockHeight)
Returns true if the given block height is "within" this version: after or on its start block, but before the start block of the next version.boolean
isFuture()
Returns true iff the current block height (Context.blockHeight
) is lower than the initial block height (startBlock
) of this version.boolean
isPast()
Returns true iff the current block height (Context.blockHeight
) is higher or equal than the initial block height (startBlock
) of this version.boolean
startsBefore(int blockHeight)
Returns true iff the start block of this version is before the given block height.boolean
startsBefore(Natural blockHeight)
Returns true iff the start block of this version is before the given block height.static EthereumVersion
valueOf(String name)
Returns the enum constant of this type with the specified name.static EthereumVersion[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
FRONTIER
-
FRONTIER_THAWING
-
HOMESTEAD
-
DAO_FORK
-
TANGERINE_WHISTLE
-
SPURIOUS_DRAGON
-
BYZANTIUM
-
CONSTANTINOPLE
-
PETERSBURG
-
ISTANBUL
-
MUIR_GLACIER
-
BERLIN
-
LONDON
-
-
Field Details
-
startBlock
public final int startBlockBlock height where the fork took effect.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
isFuture
public boolean isFuture()Returns true iff the current block height (Context.blockHeight
) is lower than the initial block height (startBlock
) of this version. -
isPast
public boolean isPast()Returns true iff the current block height (Context.blockHeight
) is higher or equal than the initial block height (startBlock
) of this version. -
startsBefore
public boolean startsBefore(int blockHeight)Returns true iff the start block of this version is before the given block height. -
startsBefore
Returns true iff the start block of this version is before the given block height. -
contains
public boolean contains(int blockHeight)Returns true iff the given block height is "within" this version: after or on its start block, but before the start block of the next version. -
contains
Returns true if the given block height is "within" this version: after or on its start block, but before the start block of the next version.
-