get_midnight_block

Documentation for eth_defi.testing.fork_blocks.get_midnight_block function.

get_midnight_block(chain_id)

Return the canonical midnight fork block for a chain id.

Parameters

chain_id (int) – EVM chain id, e.g. 1 for Ethereum mainnet.

Returns

Fixed block number to fork at (see module docstring).

Raises

KeyError – If the chain has no canonical midnight block recorded (e.g. a chain without archive history, or one not yet added here).

Return type

int