Commit graph

239 commits

Author SHA1 Message Date
SomberNight
d844b20d41
transaction.py: sign_txin. allow override for get_preimage_script.
test_commitment_tx_with_all_five_HTLCs_untrimmed_minimum_feerate now passes
2018-11-05 19:58:22 +01:00
ThomasV
8ee71b623f
lnbase: verify remote signature 2018-11-05 19:58:21 +01:00
Janus
e76f7a2ca8
lnbase: improve htlc_tx generation (only localsig wrong) 2018-11-05 19:58:20 +01:00
SomberNight
244fe2f4c5
get_per_commitment_secret_from_seed: small clean-up 2018-11-05 19:58:20 +01:00
Janus
43e2f4ae35
fix derive_secret 2018-11-05 19:58:19 +01:00
SomberNight
b15a74c95a
get_per_commitment_secret_from_seed (not working yet) 2018-11-05 19:58:19 +01:00
Janus
729dde2bb4
lnbase: avoid race while waiting for funding_locked, wait for un-reversed hash 2018-11-05 19:58:18 +01:00
Janus
0e042384a4
complete bolt11 port to ecdsa instead of secp256k1 2018-11-05 19:58:18 +01:00
SomberNight
42b222a8b8
channel_establishment_flow: wait for confirmations of funding txn 2018-11-05 19:58:17 +01:00
ThomasV
b8ab08b2cc
lnbase: fix parameters to make_commitment in htlc test 2018-11-05 19:58:16 +01:00
SomberNight
8b7b3382b0
transaction.py: shortcut witness/scriptSig serialisation 2018-11-05 19:58:16 +01:00
ThomasV
af67aff4fc
lnbase: fix initial commitment transaction 2018-11-05 19:58:13 +01:00
SomberNight
0ac170e0ae
refactor storage of channels, path finding 2018-11-05 19:58:13 +01:00
Janus
122ad8a50c
lnbase: more work on make_htlc_tx 2018-11-05 19:58:12 +01:00
Janus
9246b2a187
lnbase: make_htlc_tx 2018-11-05 19:58:11 +01:00
ThomasV
6d5e240b1c
fix: use remote_per_commitment_point 2018-11-05 19:58:11 +01:00
ThomasV
ad5b1e4268
lnbase: derive blinded pubkey 2018-11-05 19:58:10 +01:00
ThomasV
56901f709c
lnbase: add privkey derivation 2018-11-05 19:58:09 +01:00
ThomasV
dc97fccb0a
add test for key derivation 2018-11-05 19:58:09 +01:00
Janus
30581b32f1
lnbase: test signing of first htlc test case 2018-11-05 19:58:08 +01:00
Janus
3160ea30fd
lnbase: make_received_htlc 2018-11-05 19:58:08 +01:00
ThomasV
635d924dff
cleanup lnbase tests 2018-11-05 19:58:07 +01:00
SomberNight
6115c0a15e
naive route finding 2018-11-05 19:58:06 +01:00
Janus
07a9ab8fae
lnbase: offered htlc script construction 2018-11-05 19:58:05 +01:00
ThomasV
dccec08aa3
lightning: separate testing from main code 2018-11-05 19:58:04 +01:00
ThomasV
c2de68fd43
lnbase: verify signature in node_announcement 2018-11-05 19:58:02 +01:00
ThomasV
6798eb3916
lnbase: fix test 2018-11-05 19:58:01 +01:00
SomberNight
34f54f8a43
fixes for make_commitment, but still incorrect destination address (csv arg?) 2018-11-05 19:57:59 +01:00
ThomasV
dc219e04d3
lnbase: fix tx amounts 2018-11-05 19:57:59 +01:00
Janus
3d5fa38798
lnbase_test: add first commitment tx with 5 htlcs test 2018-11-05 19:57:58 +01:00
ThomasV
d047f45a0c
lnbase: fix locktime and nsequence 2018-11-05 19:57:58 +01:00
Janus
9f1f72d55f
lnbase_test: insert remote_signature and compare fields independently 2018-11-05 19:57:57 +01:00
ThomasV
d276687faa
lnbase: create unit test for commitment tx 2018-11-05 19:57:57 +01:00
Janus
097ac144d9 file reorganization with top-level module 2018-07-13 14:01:37 +02:00
SomberNight
8b86f21520
wizard: extend derivation dialog to also let user select script type.
enable segwit multisig for bip39/hw wallets.
2018-06-26 19:31:05 +02:00
ThomasV
24818c14ca
Merge pull request #3762 from SomberNight/txin_type_address_segwit
change partial txn serialization format for imported addresses txins
2018-06-22 13:58:15 +02:00
SomberNight
170f41f50d
tests: sweeping p2pk 2018-06-18 20:06:17 +02:00
SomberNight
59c1d03f01
ecc.py: properly handle point at infinity 2018-06-16 06:34:03 +02:00
SomberNight
1a8e8bc047
bitcoin.py: make int_to_hex throw on overflow 2018-06-16 02:34:27 +02:00
SomberNight
2cc15fca57
tests: add missing txid test from #3316 2018-06-15 15:39:09 +02:00
ghost43
cc05c09d6b
minikeys: import with uncompressed pubkey instead of compressed (#4384) 2018-06-15 15:32:00 +02:00
SomberNight
6297996d12
tests: (tx signing) offline hd multisig, online address 2018-06-15 15:07:56 +02:00
SomberNight
46fdbbbce5
change partial txn serialization format for imported addresses txins
offline signing with segwit WIF keys now works.
offline seed + online address signing now works.
2018-06-15 14:08:20 +02:00
SomberNight
d150f0dfc0
tests: rbf and cpfp 2018-06-15 14:05:30 +02:00
SomberNight
0438bbc2c2
transaction.py: change update_signatures API. fix trezor segwit signing.
Traceback (most recent call last):
  File "...\electrum\lib\transaction.py", line 498, in parse_witness
    if txin['witness_version'] != 0:
KeyError: 'witness_version'
2018-06-14 20:13:04 +02:00
SomberNight
5d7157451f
tests: TestWalletOfflineSigning 2018-06-13 19:27:07 +02:00
SomberNight
e8b5bcf31e
fix incorrect txid for partial segwit txns
follow-up #4405
2018-06-13 15:54:45 +02:00
SomberNight
a0ba5a7962
change partial txn format: add header. only parse inputs and witness for partial txns. 2018-06-11 17:57:29 +02:00
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
141994ed1b
tests: TestWalletSending - also test raw_tx and wtxid 2018-06-01 18:05:49 +02:00