ScanState

Documentation for eth_defi.event_reader.state.ScanState Python class.

class ScanState[source]

Scan state resume interface.

Save and load scan state somewhere, so we do not need to start scan from the scratch on abort.

Methods summary

__init__()

restore_state(default_block)

Restore the last block we have processes.

save_state(last_block)

Saves the last block we have read.

abstract save_state(last_block)[source]

Saves the last block we have read.

abstract restore_state(default_block)[source]

Restore the last block we have processes.

Returns

Tuple (did we restore state, the first block numebr to scan)

Parameters

default_block (int) –

Return type

Tuple[bool, int]