ChainReorganisationResolution

Documentation for eth_defi.event_reader.reorganisation_monitor.ChainReorganisationResolution Python class.

class ChainReorganisationResolution

Bases: object

How did we fare getting hashes and timestamps for the latest blocks.

Attributes summary

last_live_block

latest_block_with_good_data

reorg_detected

Methods summary

__init__(last_live_block, ...)

get_read_range()

Get the range of blocks we should read on this poll cycle.

__init__(last_live_block, latest_block_with_good_data, reorg_detected)
Parameters
  • last_live_block (int) –

  • latest_block_with_good_data (int) –

  • reorg_detected (bool) –

Return type

None

get_read_range()

Get the range of blocks we should read on this poll cycle.

  • This range may overlap your previous event read range.

  • You should discard any data that’s older than the start of the range

  • You should be prepared to read an event again

Returns

(start block, end block) inclusive range

Return type

Tuple[int, int]