Fork Criteria

Introduction

Classes for specifying criteria for Mainnet forks.

Module Contents

Classes

ForkCriteria

Type that represents the condition required for a fork to occur.

ByBlockNumber

Forks that occur when a specific block number has been reached.

ByTimestamp

Forks that occur when a specific timestamp has been reached.

Unscheduled

Forks that have not been scheduled.

Module Details

ForkCriteria

Type that represents the condition required for a fork to occur.

class ForkCriteria

Bases: abc.ABC

BLOCK_NUMBER :Final[int] = 0
TIMESTAMP :Final[int] = 1
UNSCHEDULED :Final[int] = 2
_internal :Tuple[int, int]
__eq__(other: object)bool

Equality for fork criteria.

__lt__(other: object)bool

Ordering for fork criteria. Block number forks are before timestamp forks and scheduled forks are before unscheduled forks.

__hash__()int

ForkCriteria is hashable, so it can be stored in dictionaries.

abstract check(block_number: int, timestamp: int)bool

Check whether fork criteria have been met.

abstract __repr__()str

String representation of this object.

ByBlockNumber

Forks that occur when a specific block number has been reached.

class ByBlockNumber(block_number: int)

Bases: ForkCriteria

block_number :int
check(block_number: int, timestamp: int)bool

Check whether the block number has been reached.

__repr__()str

String representation of this object.

ByTimestamp

Forks that occur when a specific timestamp has been reached.

class ByTimestamp(timestamp: int)

Bases: ForkCriteria

timestamp :int
check(block_number: int, timestamp: int)bool

Check whether the timestamp has been reached.

__repr__()str

String representation of this object.

Unscheduled

Forks that have not been scheduled.

class Unscheduled

Bases: ForkCriteria

check(block_number: int, timestamp: int)bool

Unscheduled forks never occur.

__repr__()str

String representation of this object.