Commit graph

41 commits

Author SHA1 Message Date
SomberNight
ab4e2dd9f0
wallet: fix is_mine/can_sign. don't just rely on ks, also check script
Previously a standard (single-sig) wallet would consider a multisig txin as is_mine
(if the keystore found its pubkey in the txin).

fixes #5948
2020-02-12 18:14:07 +01:00
SomberNight
de1ca27d63
tests: rm "needs_test_with_all_ecc_implementations" decorator
now libsecp256k1 is the only implementation
2020-02-11 16:46:31 +01:00
ThomasV
e1ce3aace7 Separate db from storage
- storage is content-agnostic
 - db and storage are passed to wallet contructor
2020-02-10 17:45:23 +01:00
SomberNight
fcd9752f19
keystore: change derive_pubkey API to return bytes 2019-12-10 20:41:47 +01:00
SomberNight
8e89c0c971
wallet: some clean-up re get_address_history vs db.get_addr_history
note: tests needed changing due to behavioural change in wallet.get_receiving_address()
Previously wallet.get_receiving_address used wallet.db.get_addr_history,
now it (indirectly) uses wallet.get_address_history, which now also considers local txns.
2019-12-07 05:42:28 +01:00
SomberNight
5b88b8667e
also grind ecdsa low R when using libsecp256k1, and fix tests
note: low R grinding would not have to be duplicated if we trusted the caller
to have done it already (as is the case with the classes in ecc.py), and if
we propagated the choice of "random_k" as part of the nonce_function passed
to libsecp256k1 (which is not currently done)
2019-12-05 20:27:55 +01:00
SomberNight
c0b5ebcc5d
tests: fix testcase test_restoring_wallet_with_manual_delete 2019-11-29 13:09:21 +01:00
ThomasV
06589df812 simplify add_transaction 2019-11-23 12:46:43 +01:00
SomberNight
6573e7f1f3
test_wallet_vertical: add test for manual coinjoin 2019-11-06 18:40:16 +01:00
SomberNight
8e09d429c0
psbt: "updater" must swap NON_WITNESS_UTXO for WITNESS_UTXO if txin is segwit 2019-11-06 03:46:00 +01:00
SomberNight
c077d77316
psbt: test_wallet_vertical: add asserts to avoid silent breakage of psbts we create 2019-11-06 03:42:14 +01:00
SomberNight
bafe8a2fff
integrate PSBT support natively. WIP 2019-11-04 22:24:36 +01:00
SomberNight
d9b5ab3086
wallet: fix bump_fee when there are only change outputs
closes #5718
closes #5603
2019-10-22 17:12:23 +02:00
SomberNight
04edad9984
config: no longer singleton. it is passed to Wallet.__init__
The few other cases that used SimpleConfig.get_instance() now
either get passed a config instance, or they try to get a reference
to something else that has a reference to a config.
(see lnsweep, qt/qrcodewidget, qt/qrtextedit)
2019-09-22 20:46:01 +02:00
SomberNight
9eee36fe00
follow-up prev 2019-09-10 20:18:53 +02:00
SomberNight
098636c69a
fix tests 2019-09-10 19:39:52 +02:00
ThomasV
cefa4762ba do not create multiple instances of SimpleConfig (fix #5629). Add config field to wallet 2019-09-10 08:57:40 +02:00
SomberNight
aadde9be17
transaction: fix remove_signatures
closes #5491
2019-07-05 21:16:58 +02:00
SomberNight
94b721baa4
wallet: fix type error in _bump_fee_through_decreasing_outputs
fixes #5483
2019-07-04 17:23:34 +02:00
SomberNight
e0b1bbfc46
tests: new tests for bump_fee and rbf_batching 2019-06-20 22:42:50 +02:00
SomberNight
0c20fcb6b3
tests: fix existing bump_fee tests 2019-06-20 22:42:49 +02:00
SomberNight
d0a43662bd
wallet: make "increase fee" RBF logic smarter
There are now two internal strategies to bump the fee of a txn.
bump fee method 1: keep all inputs, keep all not is_mine outputs,
                   allow adding new inputs
bump fee method 2: keep all inputs, no new inputs are added,
                   allow decreasing and removing outputs (change is decreased first)
Method 2 is less "safe" as it might end up decreasing e.g. a payment to a merchant;
but e.g. if the user has sent "Max" previously, this is the only way to RBF.

We try method 1 first, and fail-over to method 2.
Previous versions always used method 2.

fixes #3652
2019-06-20 22:42:48 +02:00
SomberNight
e3c26d7c7a
json_db: fix remove_spent_outpoint
method should make sure prevout_n is str...
also wrote failing test
2019-06-15 03:51:11 +02:00
ThomasV
d74f0c0947 storage_db: fix tests, add modified flag to db class 2019-02-28 12:09:36 +01:00
SomberNight
b39c51adf7
mv "electrum seed" stuff from bitcoin.py to mnemonic.py 2019-02-22 18:01:54 +01:00
SomberNight
d820f9ad37
transaction: change default version to 2 2019-01-28 15:11:03 +01:00
ghost43
dc19cf1fa1
wallet: randomise locktime of transactions a bit. also check if stale. (#4967) 2019-01-16 18:51:59 +01:00
SomberNight
0657bb1b36
test_wallet_vertical: add segwit 2fa test 2018-12-14 23:01:52 +01:00
ThomasV
df59a43300 fix test 2018-12-11 09:28:35 +01:00
ThomasV
5a93bf054e 2fa segwit (from ghost43's PR) 2018-12-11 09:28:35 +01:00
SomberNight
e8a8a17217
test_wallet_vertical: offline sign with old seed 2018-12-05 18:55:19 +01:00
SomberNight
f767d41409
tests: spanish test case for mnemonic.py, and refactoring 2018-11-14 18:58:27 +01:00
SomberNight
7d114ff32d
cpfp: don't reuse address 2018-11-07 14:48:33 +01:00
SomberNight
34569d172f
wallet: make importing thousands of addr/privkeys fast
fixes #3101
closes #3106
closes #3113
2018-10-27 17:36:10 +02:00
SomberNight
626828e980
fix sweeping 2018-10-01 05:16:03 +02:00
SomberNight
999ae1f713
test_mnemonic: add foreign lang tests 2018-09-10 02:03:42 +02:00
Dzhelil Rufat
c9ffffc526 Remove unneccessary imports from the unit testing directory. (#4699) 2018-09-08 17:24:23 +02:00
SomberNight
2eb72d496f
transaction: introduce TxOutput namedtuple 2018-08-01 19:10:08 +02:00
SomberNight
aa86440866
fix #4566: bip39 passphrases with multiple spaces 2018-07-18 18:42:04 +02:00
ThomasV
e3888752d6 separate address synchronizer from wallet 2018-07-18 11:18:57 +02:00
Janus
097ac144d9 file reorganization with top-level module 2018-07-13 14:01:37 +02:00
Renamed from lib/tests/test_wallet_vertical.py (Browse further)