Skip to content

Annotate FORK_CRITERIA with ForkCriteria #1753

@SamWilsn

Description

@SamWilsn

Type checkers infer the most specific type they can from an assignment. Because it's routine for us to go from Unscheduled to ByTimestamp, we should annotate FORK_CRITERIA with the supertype to avoid a breaking API change.

For example, this:

from ethereum.fork_criteria import ByBlockNumber
FORK_CRITERIA = ByBlockNumber(0)

Should become:

from ethereum.fork_criteria import ByBlockNumber, ForkCriteria

FORK_CRITERIA: ForkCriteria = ByBlockNumber(0) 

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-spec-specsArea: Specification—The Ethereum specification itself (eg. `src/ethereum/*`)C-bugCategory: this is a bug, deviation, or other problemE-easyExperience: easy, good for newcomersP-lowS-needs-attentionStatus: needs attention

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions