Commit Graph

185 Commits

Author SHA1 Message Date
Janus
ba265da02a fix derive_secret 2018-07-13 16:43:24 +02:00
SomberNight
3a5e3f19db get_per_commitment_secret_from_seed (not working yet) 2018-07-13 16:43:24 +02:00
Janus
e0d28e3f6e lnbase: avoid race while waiting for funding_locked, wait for un-reversed hash 2018-07-13 16:43:24 +02:00
Janus
af8374b02e complete bolt11 port to ecdsa instead of secp256k1 2018-07-13 16:43:24 +02:00
SomberNight
527712df48 channel_establishment_flow: wait for confirmations of funding txn 2018-07-13 16:43:24 +02:00
ThomasV
64c8c74445 lnbase: fix parameters to make_commitment in htlc test 2018-07-13 16:43:24 +02:00
SomberNight
1bd4b5e73e transaction.py: shortcut witness/scriptSig serialisation 2018-07-13 16:43:24 +02:00
ThomasV
836fae809c lnbase: fix initial commitment transaction 2018-07-13 16:43:24 +02:00
SomberNight
e7bae0fe5d refactor storage of channels, path finding 2018-07-13 16:43:24 +02:00
Janus
c5a9b2d19a lnbase: more work on make_htlc_tx 2018-07-13 16:43:24 +02:00
Janus
80c8ea15e0 lnbase: make_htlc_tx 2018-07-13 16:43:24 +02:00
ThomasV
f4c7702c0a fix: use remote_per_commitment_point 2018-07-13 16:43:24 +02:00
ThomasV
205cd259fd lnbase: derive blinded pubkey 2018-07-13 16:43:24 +02:00
ThomasV
3b3732e82d lnbase: add privkey derivation 2018-07-13 16:43:24 +02:00
ThomasV
b9633896da add test for key derivation 2018-07-13 16:43:24 +02:00
Janus
66d139b515 lnbase: test signing of first htlc test case 2018-07-13 16:43:24 +02:00
Janus
53ddc373d5 lnbase: make_received_htlc 2018-07-13 16:43:24 +02:00
ThomasV
a14b54dbe5 cleanup lnbase tests 2018-07-13 16:43:24 +02:00
SomberNight
9796ef264e naive route finding 2018-07-13 16:43:24 +02:00
Janus
d3d23066e9 lnbase: offered htlc script construction 2018-07-13 16:43:24 +02:00
ThomasV
1ded2fd7b2 lightning: separate testing from main code 2018-07-13 16:43:24 +02:00
ThomasV
dcd4ea23db lnbase: verify signature in node_announcement 2018-07-13 16:43:24 +02:00
ThomasV
13cb82a203 lnbase: fix test 2018-07-13 16:43:24 +02:00
SomberNight
f1017b9ed7 fixes for make_commitment, but still incorrect destination address (csv arg?) 2018-07-13 16:43:24 +02:00
ThomasV
1d319ff22f lnbase: fix tx amounts 2018-07-13 16:43:24 +02:00
Janus
446b5c9f45 lnbase_test: add first commitment tx with 5 htlcs test 2018-07-13 16:43:24 +02:00
ThomasV
005f6165fa lnbase: fix locktime and nsequence 2018-07-13 16:43:24 +02:00
Janus
a543ec27fb lnbase_test: insert remote_signature and compare fields independently 2018-07-13 16:43:24 +02:00
ThomasV
5aba0b9538 lnbase: create unit test for commitment tx 2018-07-13 16:43:24 +02: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
SomberNight
deb945d810
tests: TestWalletHistory_EvilGapLimit 2018-05-29 20:51:04 +02:00
SomberNight
7218bf1d14
tests: bip32 extended version bytes 2018-05-28 20:27:08 +02:00
SomberNight
dbec3af810
tests: introduce FAST_TESTS flag for faster local testing 2018-05-28 14:02:07 +02:00
SomberNight
d03da4d1a2
tests: test with all AES implementations 2018-05-25 22:06:45 +02:00