[electrum] typehints and minor cleanup in blockchain.py
Summary:
- Use an Enum for the chunk status for type safety and annotations
- Add various typehints when the static analysis tools can't reliably guess from context
- Refactor check_header and rename to get_chain_for_header. The return value is more than just a boolean, and it is treated as more than just a boolean by the callsites.
Test Plan:
python test_runner.py pytest electrumabc/tests/regtest
Check that the CHUNK_* constants were not used anywhere except for checking the return status of Blockchain.connect_chunk and for log messages.
Run the software, send a transaction, wait for a new block.
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D14950