Commit graph

1051 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
792c248919
Qt: FeerateEdit.get_amount now returns sat/byte 2018-06-04 21:17:25 +02:00
Johann Bauer
d288999036 i18n template improvements 2018-05-31 11:05:44 +02:00
SomberNight
c34273b771
(minor) missing space in message when deleting wallet 2018-05-29 13:40:36 +02:00
SomberNight
16e4827e8c
use libsecp256k1 if available. abstract away ecc stuff. move symmetric crypto and hash functions to crypto.py 2018-05-25 15:43:06 +02:00
ThomasV
4c234397ec
Merge pull request #4351 from SomberNight/2fa_sign_then_otp
trustedcoin: sign first, then prompt for OTP
2018-05-18 17:36:18 +02:00
SomberNight
a9bf664a5e
qt: network status text to tell user proxy is enabled when network can't connect 2018-05-17 00:48:14 +02:00
SomberNight
150cbb5d9c
fix #4356: qt/tx_dialog - move save local button to left.
also: properly parent popup, and add extra note re what local tx ('save') means
2018-05-14 17:00:29 +02:00
ghost43
dae187bada
allow fractional feerates (#4324) 2018-05-09 19:30:18 +02:00
SomberNight
ceae43afe5
trustedcoin: sign first, then prompt for OTP 2018-05-08 20:04:36 +02:00
SomberNight
c03d68d758
add 'sat' as base unit option 2018-05-05 12:52:19 +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
SomberNight
a161b6e655
RBF: make sure we know the fee for the old txn
related #4306
2018-04-24 15:30:13 +02:00
SomberNight
9fb927a068
minor py3 fix: language setting in qt/preferences 2018-04-23 20:06:54 +02:00
Ben Woosley
d7750c73e6 Use keyword arguments for format_amount call clarity (#4290) 2018-04-23 18:17:29 +02:00
Dimitris Apostolou
989c9c2b55 Fix typos 2018-04-15 20:34:40 +02:00
Filip Gospodinov
dcf25f9121 qt: allow copying receiving address using ctrl-c (#4258)
"You must enable keyboard focus for a widget if it
processes keyboard events."

https://doc.qt.io/qt-5/qwidget.html#focusPolicy-prop

On macOS it works without this patch already for some reason.
2018-04-15 16:19:37 +02:00
SomberNight
75f0221617
minor grammar fix in qt/preferences 2018-04-11 15:47:23 +02:00
SomberNight
985fe24f18
fix #4240 2018-04-08 15:13:12 +02:00
ghost43
54d220c311
Merge branch 'master' into TextCompleter 2018-04-05 15:29:10 +02:00
SomberNight
42582b6a64
fix #4219 2018-04-03 02:48:55 +02:00
Lucas Betschart
b1aba416e4 Use HTTPS for weblinks 2018-03-26 12:17:44 +02:00
SomberNight
c0a42b756b fix #4159 2018-03-22 08:18:27 +01:00
SomberNight
a00439b6f8 fix #4158 2018-03-22 07:27:18 +01:00
SomberNight
800ea1e300 typos in gui/qt/main_window.py 2018-03-20 00:54:29 +01:00
SomberNight
71dff2a06e fix #4128 2018-03-15 14:17:27 +01:00
SomberNight
1bc5640636 qt main_window change_password_dialog: catch InvalidPassword instead 2018-03-15 08:25:31 +01:00
ThomasV
38ec65716c fix #4116 2018-03-13 15:31:29 +01:00
Johann Bauer
d71d22d279 Fix Typo 2018-03-10 14:55:06 +01:00
Lastrellik
b3d7348020 Display suggestions when restoring from seed #1116 2018-03-07 20:39:57 -07:00
SomberNight
dc2bb7d81f fix prev 2018-03-06 17:26:59 +01:00
SomberNight
3a5a0af48f fix #4047 2018-03-06 17:20:22 +01:00
SomberNight
ba3ac1b648 fee ui qt: fee_e and feerate_e was sometimes not getting filled 2018-03-06 09:21:58 +01:00
ThomasV
ab042a0914 fix #4040 2018-03-06 07:08:38 +01:00
ThomasV
89599cf0d5 simplify fee preferences dialog 2018-03-05 10:12:44 +01:00
SomberNight
81b6d65764 refactor network constants 2018-03-04 22:10:59 +01:00
ThomasV
2a51914c31 improve message 2018-03-02 17:33:41 +01:00
SomberNight
724ed874aa toggle capital gains columns in qt history tab 2018-03-01 19:05:51 +01:00
SomberNight
b963dc1d0d persist history and addresses toolbars (qt) 2018-03-01 16:33:06 +01:00
Johann Bauer
540b230c8a
Use icon for tx saving success message 2018-02-27 16:59:39 +01:00
ThomasV
ac176db221 follow-up previous commit 2018-02-27 12:03:35 +01:00
ThomasV
76734f6a88 fix #3980 2018-02-27 12:02:52 +01:00
ThomasV
26e966c3e0 hide address and history toolbars, move functions back into menu. 2018-02-27 11:52:35 +01:00
SomberNight
b5badc385f fix #3965 2018-02-24 20:49:56 +01:00
ThomasV
554cf91cff
Merge pull request #3599 from SomberNight/fix_wrapped_c_object_has_been_deleted
fix some crashes when the underlying QT (C/C++) object no longer exists
2018-02-23 12:10:30 +01:00
ThomasV
18ba4319da
Merge pull request #3951 from SomberNight/file_import_export_unification
File import-export unification
2018-02-23 11:46:04 +01:00
ThomasV
24054ac399
Merge pull request #3943 from SomberNight/fee_cleanup
clean up fees a bit
2018-02-23 10:11:20 +01:00
SomberNight
500c0493d0 clean up prev commit 2018-02-21 19:22:07 +01:00
Abdussamad
5997c18aef better code organization
function parameters should be lowercase

Fix crash on invalid labels import

Added invoice exporting and reduced duplicate code

Better exception handling

removed json module import

some more cleanup

Cleaned up some stuff

Added exporting contacts
2018-02-21 19:00:41 +01:00
SomberNight
93619c8341 make qt gui even more resistant against ill-formed txns
see #3945
2018-02-21 13:31:01 +01:00