[electrum] minor cleanup of Transaction.fetch_input_data
Summary:
- put comments on previous line to let the automatic code formatting do its job
- save some indentation levels
- add a few typehints
- use f-strings
- tx_cache_put is always called with a valid Transaction, no need to check for tx is not None
- move imports to the top of the file (they are always imported anyway by other modules, and multiple imports add no significant additional cost)
Test Plan: send a transaction between two different wallets; in the receiving wallet double-click on the tx in the history, check that the dialog knows the input amount
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Subscribers: Fabien
Differential Revision: https://reviews.bitcoinabc.org/D14514