LBRY-Vault/gui/qt
Harm Aarts e57e55aad8 Remove explicit send calls, part deux (#4408)
* Rename synchronous_get to synchronous_send

This makes it more inline with the method 'send' of which
synchronous_send is the, well, synchronous version.

* Move protocol strings from scripts to network

This is again a small step in the right direction. The network module is
going to accumulate more and more of these simple methods. Once
everything is moved into that module, that module is going to be split.

Note that I've left the scripts which use scripts/util.py alone. I
suspect the same functionality can be reached when using just
lib/network.py and that scripts/util.py is obsolete.

* Remove protocol string from verifier and websocket

Websocket still has some references, that'll take more work to remove. Once the
network module has been split this should be easy.
I took the liberty to rename a variable to better show what it is.

* Remove protocol strings from remainder

The naming scheme I'm following for the newly introduced methods in the network
module is: 'blockchain.<subject>.<action>' -> def <action>_(for|to)_<subject>

* Move explicit protocol calls closer to each other

This makes it easier to keep track of the methods which are due to be
extracted.

* Remove `send` when using `get_transaction`

This is the final step to formalize (the informal) interface of the network
module.
A chance of note is changed interface for async/sync calls. It is no longer
required to use the `synchronous_send` call. Merely NOT passing a callback
makes the call synchronous. I feel this makes the API more intuitive to work
with and easier to replace with a different network module.

* Remove send from get_merkle_for_transaction

The pattern which emerged for calling the lambda yielded an slight refactor.
I'm not happy with the name for the `__invoke` method.

* Remove explict send from websockets

* Remove explicit send from scripts

* Remove explicit send from wallet

* Remove explicit sync_send from commands, scripts

* Remove optional timeout parameter

This parameter doesn't seem to be used a lot and removing it makes the
remaining calls easier. Potentionally a contentious choice!

* Rename `broadcast` to `broadcast_transaction`

Doing so makes the method name consistent with the other ElectrumX protocol
method names.

* Remove synchronous_send

Now every method is intuitive in what it does, no special handling required.
The `broadcast_transaction` method is weird. I've opted not to change the
return type b/c I found it hard to know what the exact consequences are. But
ideally this method should just works as all the other ElectrumX related
messages. On the other hand this shows nicely how you _can_ do something
differnt quite easy.

* Rename the awkwardly name `__invoke` method

The new name reflects what it does.

* Process the result of linter feedback

I've used flake8-diff (and ignored a couple of line length warnings).

* Rename tx_response to on_tx_response

This fell through the cracks when this branch was rebased.

* subscript_to_scripthash should be get_balance

An oversight while refactoring.

* Add missing return statement

Without this statement the transaction would have been broadcasted twice.

* Pass list of tuples to send not single tuple

* Add @staticmethod decorator

* Fix argument to be an array
2018-06-06 15:06:04 +02:00
..
__init__.py qt: show start-up wizard in case of exception 2018-05-11 00:03:01 +02:00
address_dialog.py fix #3619: set correct parent window 2018-01-12 12:13:19 +01:00
address_list.py Qt: addresses tab - align text 2018-06-04 22:37:34 +02:00
amountedit.py Qt: FeerateEdit.get_amount now returns sat/byte 2018-06-04 21:17:25 +02:00
completion_text_edit.py Display suggestions when restoring from seed #1116 2018-03-07 20:39:57 -07:00
console.py fix #4075 2018-03-08 09:49:11 +01:00
contact_list.py clean up prev commit 2018-02-21 19:22:07 +01:00
exception_window.py Fix typos 2018-04-15 20:34:40 +02:00
fee_slider.py use config.is_dynfee and config.use_mempool_fees 2018-02-13 00:03:42 +01:00
history_list.py RBF: make sure we know the fee for the old txn 2018-04-24 15:30:13 +02:00
installwizard.py scaled pixmaps no longer pixelated 2018-06-01 22:36:56 +02:00
invoice_list.py make qt HistoryList.on_update() faster by caching icons 2018-04-04 15:47:11 +02:00
main_window.py Remove explicit send calls, part deux (#4408) 2018-06-06 15:06:04 +02:00
network_dialog.py refactor network constants 2018-03-04 22:10:59 +01:00
password_dialog.py scaled pixmaps no longer pixelated 2018-06-01 22:36:56 +02:00
paytoedit.py Merge branch 'master' into TextCompleter 2018-04-05 15:29:10 +02:00
qrcodewidget.py fix #3663: 'copying' QR code does not save to file 2018-01-08 02:28:13 +01:00
qrtextedit.py fix #4036 2018-03-06 11:22:49 +01:00
qrwindow.py Remove unused imports. Explicitly import a few deep imports. 2017-11-13 02:28:00 -06:00
request_list.py fix #4330 2018-05-02 11:56:03 +02:00
seed_dialog.py scaled pixmaps no longer pixelated 2018-06-01 22:36:56 +02:00
transaction_dialog.py i18n template improvements 2018-05-31 11:05:44 +02:00
util.py qt: for dark color scheme, fix yellow 2018-04-12 02:41:33 +02:00
utxo_list.py Enable sorting of list widgets 2018-03-02 12:24:18 +01:00