Commit Graph

170 Commits

Author SHA1 Message Date
Janus 4b8f279d50 lnbase: test signing of first htlc test case 2019-08-20 09:03:09 +02:00
Janus fa86dda983 lnbase: make_received_htlc 2019-08-20 09:03:09 +02:00
ThomasV 2c717194b2 cleanup lnbase tests 2019-08-20 09:03:09 +02:00
SomberNight f8f365f1ea naive route finding 2019-08-20 09:03:09 +02:00
Janus a23aac76d3 lnbase: offered htlc script construction 2019-08-20 09:03:09 +02:00
ThomasV 60d6080fe5 lightning: separate testing from main code 2019-08-20 09:03:09 +02:00
ThomasV 969708316c lnbase: verify signature in node_announcement 2019-08-20 09:03:09 +02:00
ThomasV 57b63cf490 lnbase: fix test 2019-08-20 09:03:09 +02:00
SomberNight aaa67adb5a fixes for make_commitment, but still incorrect destination address (csv arg?) 2019-08-20 09:03:09 +02:00
ThomasV eca8d13e37 lnbase: fix tx amounts 2019-08-20 09:03:09 +02:00
Janus 3fb6951d10 lnbase_test: add first commitment tx with 5 htlcs test 2019-08-20 09:03:09 +02:00
ThomasV 316f9a3954 lnbase: fix locktime and nsequence 2019-08-20 09:03:09 +02:00
Janus 814146f099 lnbase_test: insert remote_signature and compare fields independently 2019-08-20 09:03:09 +02:00
ThomasV 7b6f64a402 lnbase: create unit test for commitment tx 2019-08-20 09:03:09 +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
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
SomberNight 756cc323e7 tests: dnssec 2018-05-24 22:20:58 +02:00
SomberNight c113232e8b tests: TestWalletHistory
check if wallet logic calculates correct balance regardless of the order in which we receive transactions from the server
2018-05-18 15:43:02 +02:00
SomberNight 7c7aa5828b tests: added p2wpkh-p2sh wallet to TestWalletSending 2018-05-14 18:33:14 +02:00
ghost43 3337af0734 transaction.py: (txin guess) fix some false positive matches of p2sh-segwit (#4336) 2018-05-09 19:16:01 +02:00
SomberNight fad25af204 fix tests for travis. follow-up 68d8919416 2018-04-27 21:55:50 +02:00
SomberNight 68d8919416 tests: sends between wallets 2018-04-27 21:43:46 +02:00
SomberNight e13183ea7a bitcoin.py: SCRIPT-related clean-up. transaction.py: construct_witness 2018-04-27 16:16:27 +02:00
SomberNight b3110b3b46 bitcoin.py: implement add_number_to_script. 2018-04-27 16:15:44 +02:00
SomberNight 4b89b1e270 implement script_num_to_hex 2018-04-27 16:15:43 +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 44bb1e9993 bitcoin.py: fix op_push
https://github.com/bitcoin/bitcoin/blob/8cbc5c4be4be22aca228074f087a374a7ec38be8/src/script/script.h#L464
https://github.com/btcsuite/btcd/blob/fdc2bc867bda6b351191b5872d2da8270df00d13/txscript/scriptbuilder.go#L151
2018-04-14 16:13:51 +02:00
ghost43 cf88e239d7 fix parsing values in setconfig (#4225) 2018-04-06 18:53:13 +02:00
SomberNight 58273fc841 tests: xpub version bytes 2018-04-01 16:56:17 +02:00
SomberNight ff57c198b4 fix prev 2018-04-01 16:52:24 +02:00