Commit graph

224 commits

Author SHA1 Message Date
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
SomberNight
2b84fba67b
storage upgrade as part of the wizard. fix storage upgrade on kivy. 2018-05-31 19:43:50 +02:00
SomberNight
c34273b771
(minor) missing space in message when deleting wallet 2018-05-29 13:40:36 +02:00
Ben Woosley
53320470f5 Format the transaction window fee rate with 1 decimal place (#4286)
* Fix format_satoshi to properly handle non-integer values

Handling the integer and fraction parts together via string formatting
simplifies the initial composition because the default behavior manages
the - sign, and the incorporation of the fractional part.

* Limit fee rate output to one decimal place

Via a new precision arg

* Introduce format_fee_satoshis and use it for all fee display
2018-04-24 18:54:14 +02:00
Dimitris Apostolou
989c9c2b55 Fix typos 2018-04-15 20:34:40 +02:00
ThomasV
986985c398 fix #4255 2018-04-12 16:44:59 +02:00
SomberNight
35b3294a5d
fix #4238 2018-04-09 12:00:37 +02:00
ThomasV
445ef3c6ac remove print statement 2018-03-28 10:46:08 +02:00
ThomasV
b75d82491b kivy: request PIN code on startup 2018-03-25 11:45:33 +02:00
ThomasV
971a6979ee kivy: do not open invoices, requests dialogs if list is empty 2018-03-06 19:36:57 +01:00
ThomasV
c750ec153b new kivy gui 2018-03-06 14:58:00 +01:00
ThomasV
c9b0840c78 kivy: minor fixes related to exchange rates 2018-03-04 23:58:38 +01:00
SomberNight
81b6d65764 refactor network constants 2018-03-04 22:10:59 +01:00
ThomasV
1526768cd6 kivy: simplify history screen, display either fiat or btc 2018-03-03 11:32:38 +01:00
ThomasV
d5effe48d0 kivy: do not show balance in every tab. fixes #3350 2018-03-02 19:16:08 +01:00
ThomasV
b2c7d2d2cc kivy: do not cache fee dialog 2018-03-02 10:31:00 +01:00
ThomasV
4321950f63 kivy: update fee dialog on new fee 2018-03-02 09:46:10 +01:00
ThomasV
fb761b7c12 request fee historgam every minute. show fee in the send tab of kivy gui 2018-03-01 18:28:54 +01:00
ThomasV
e82838ecbb fix #3991 2018-03-01 14:45:38 +01:00
SomberNight
ffdc36285b use string.format instead of old style (%) formatting 2018-02-04 07:26:55 +01:00
racquemis
7d52cfd374 Handle invalid PIN on exporting private key
Prevent Android App from crashing when a wrong PIN is entered.
2018-01-14 12:40:23 +01:00
ThomasV
5db7363cf8
Merge pull request #3602 from SomberNight/android_rbf_default_on
Android: make RBF on by default
2017-12-31 15:51:47 +01:00
ThomasV
a95534bb0c
Merge pull request #3624 from bauerj/zxing-integration
Bundle QR scanner with Android app
2017-12-30 20:43:35 +01:00
Johann Bauer
7ccbbe77f5 Bundle QR scanner with Android app 2017-12-29 23:16:08 +01:00
SomberNight
9d4dd20b23 fix kivy refresh bug with Addresses tab 2017-12-29 20:40:24 +01:00
SomberNight
c37608dd5e fix #3601 2017-12-25 20:52:44 +01:00
SomberNight
2e34747cc4 Android: make RBF on by default 2017-12-25 20:10:28 +01:00
ThomasV
c46f219d25 kivy: fix crash in show_private_key 2017-11-10 11:12:29 +01:00
ThomasV
786f9ce7ff
Merge pull request #3206 from ariard/kivy-addr
kivy: replace requests tab by address tab
2017-11-10 10:56:32 +01:00
SomberNight
0db5ea67a0 bitcoin.NetworkConstants: easier changing between testnet and mainnet 2017-11-09 17:47:57 +01:00
Antoine Riard
70bfcaaf59 kivy: replace requests tab by address tab 2017-11-03 11:50:30 -04:00
ThomasV
290999b9a8 kivy: py3 update for scanning transaction 2017-10-22 12:50:28 +02:00
ThomasV
1d2253f0d8 kivy: python3 imports 2017-10-21 11:03:47 +02:00
ThomasV
c3388d9677 misc python3 updates:
- use jsonrpclib-pelix
 - update the kivy gui
 - update plugins
2017-08-26 08:28:24 +02:00
ThomasV
08fab753e8 change default value of confirmed_only, spending unconfirmed coins 2017-08-08 06:03:47 +02:00
ThomasV
4c2deb6d2b follow-up to bc4fcfbebd 2017-08-01 10:47:33 +02:00
suut
bc4fcfbebd Remove usages of deprecated apply() builtin 2017-08-01 05:22:18 +02:00
ThomasV
622f459c41 kivy: minor fix (switch_to) 2017-07-24 12:04:04 +02:00
ThomasV
732679aa3d kivy: group network calback registrations 2017-07-21 10:38:50 +02:00
ThomasV
2bb980c84c kivy: trigger_update_interfaces 2017-07-21 00:09:47 +02:00
ThomasV
12b62fb27d kivy: use app.num_chain 2017-07-19 09:46:48 +02:00
ThomasV
b424a83a57 add blockchain.get_name method, update kivy gui 2017-07-19 09:29:20 +02:00
ThomasV
96a685a765 kivy: gui improvements 2017-07-12 17:23:21 +02:00
ThomasV
73b023e967 update network settings dialog of the kivy GUI 2017-07-11 18:04:33 +02:00
ThomasV
faa17f9818 Option to send only confirmed coins (fix #2395) 2017-07-03 07:46:27 +02:00
ThomasV
08fd7d95ab kivy: use NumericProperty for blocks and nodes 2017-03-30 10:13:58 +02:00
ThomasV
6185f94de4 archive paid invoices in the history tab 2017-03-15 15:32:14 +01:00
ThomasV
024de7afa5 kivy: trigger_update_history 2017-03-13 15:07:35 +01:00
ThomasV
f5083b46de kivy: nicer message on send success 2017-03-13 11:32:55 +01:00
ThomasV
0cf14635e0 kivy: always show wallet name 2017-03-09 15:04:14 +01:00