[electrum] rely on pycryptodomex being installed in hash_160
Summary:
The code was wrong and didn't work on systems with OpenSSL compiled without ripemd160 (which is now the case for the OpenSSL 3.0 default build), because the try except clauses were not properly nested.
It should have been:
try: ... except ValueError: try: ... except ImportError: ...
The last fallback option, which is a slow pure-python implementation (slowdown very noticeable in wallets with many addresses), is no longer really needed as we just made pycryptodomex an official dependency.
Note that we also have a (better maintained) ripemd pure-python implementation in the node's test framework, so this also deduplicates code in the monorepo.
Depends on D14132
Test Plan:
pip uninstall pycryptodomex pip install -r contrib/requirements/requirements.txt python run_tests.py
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D14133