Commit graph

156 commits

Author SHA1 Message Date
Byron Hambly
bd68371fb6 Merge ffdab41f94 into merged_master (Bitcoin PR bitcoin/bitcoin#23474) 2023-05-26 10:32:04 +00:00
Byron Hambly
af3fe60b69 Merge 94db963de5 into merged_master (Bitcoin PR bitcoin/bitcoin#23300) 2023-05-17 13:44:36 +00:00
Byron Hambly
117f3fef5b Merge 9aa4ddb410 into merged_master (Bitcoin PR bitcoin/bitcoin#23287) 2023-05-14 07:52:20 +00:00
Byron Hambly
b708aecb74 Merge 571bb94dfb into merged_master (Bitcoin PR bitcoin/bitcoin#23123) 2023-04-28 13:31:37 +00:00
James Dorfman
a28e1a34b5 Merge d5d0a5c604 into merged_master (Bitcoin PR bitcoin/bitcoin#17526) 2023-04-26 04:23:36 +00:00
Byron Hambly
c96554c071 Merge 09cb5ec6c8 into merged_master (Bitcoin PR bitcoin/bitcoin#23065) 2023-04-24 10:05:11 +00:00
James Dorfman
ae89c4bc51 Merge a5d00d4baf into merged_master (Bitcoin PR bitcoin/bitcoin#22788) 2023-04-21 04:02:55 +00:00
James Dorfman
3e939cca81 Merge 629c4ab2e3 into merged_master (Bitcoin PR bitcoin/bitcoin#22100) 2023-04-14 06:13:01 +00:00
MarcoFalke
fac23c2114
scripted-diff: Bump copyright headers
The previous diff touched most files in ./test/, so bump the headers to
avoid having to touch them again for a bump later.

-BEGIN VERIFY SCRIPT-
./contrib/devtools/copyright_header.py update ./test/
-END VERIFY SCRIPT-
2021-11-10 11:10:24 +01:00
MarcoFalke
fa974f1f14
scripted-diff: Remove redundant sync_all and sync_blocks
The sync calls are redundant after a call to generate, because generate
already syncs itself.

-BEGIN VERIFY SCRIPT-
perl -0777 -pi -e 's/(generate[^\n]*\)[^\n]*)(\n|\s)+self.sync_(all|blocks)\([^\)]*\)\n/\1\n/g' $(git grep -l generate ./test)
-END VERIFY SCRIPT-
2021-11-10 11:10:15 +01:00
MarcoFalke
facc352648
test: Implicitly sync after generate*, unless opted out 2021-10-29 13:34:52 +02:00
Sebastian Falbesoner
130ee48108 test: get and decode tx with a single gettransaction RPC call
Rather than subsequently calling `gettransaction` and
`decoderawtransaction` to get the decoded information  for a specific
tx-id, we can simply use the verbose version of `gettransaction`, which
returns this in a 'decoded' key. I.e.

node.decoderawtransaction(node.gettransaction(txid)['hex'])

can be replaced by:

node.gettransaction(txid=txid, verbose=True)['decoded']
2021-10-17 18:10:36 +02:00
Samuel Dobson
bccd1d942d Remove -rescan startup parameter 2021-09-30 12:06:27 +13:00
Samuel Dobson
719ae927dc Update lockunspent tests for lock persistence 2021-09-25 23:50:06 +12:00
merge-script
a5d00d4baf
Merge bitcoin/bitcoin#22788: scripted-diff: Use generate* from TestFramework
fa0b916971 scripted-diff: Use generate* from TestFramework (MarcoFalke)

Pull request description:

  This is needed for #22567.

  By using the newly added `generate*` member functions of the test framework, it paves the way to make it easier to implicitly call `sync_all` after block generation to avoid intermittent issues.

ACKs for top commit:
  jonatack:
    ACK fa0b916971

Tree-SHA512: e74a324b60250a87c08847cdfd7b6ce3e1d89b891659fd168f6dd7dc0aa718d0edd28285374a613f462f34f4ef8e12c90ad44fb58721c91b2ea691406ad22c2a
2021-09-09 14:02:45 +02:00
Andrew Poelstra
36e5e2a7f1 Merge 9a154599fe into merged_master (Elements PR ElementsProject/elements#900)
Surprisingly easy to do. Almost all of the diff resolution was mechanically
  * replacing boost::variant with std::variant
  * replacing Optional with std::optional
     * then replacing `nullopt` with `std::nullopt`
  * updating the RPC functions for the new RPCArg::Default type
  * update the tests/ directory to make new (since 22) tests use arrays for
    createrawtransaction outputs
  * other ad-hoc changes to function parameters etc (not too many of these)

I had to "really" change the code in PrecomputePSBTData, which was introduced
in 22.0 and affected by PSET, but this function was like 8 lines long so it
was easy.

Reviewing the diff may be a bit difficult because of the mix of mechanical
changes and ad-hoc things. Probably the most straightforward thing to do
is to redo the merge, `sed -i` to fix the boost::variant and Optional stuff,
then diff the remaining conflicts against this commit.

TODO: grep for `blindpsbt` and you will see that this RPC is still referenced
in documentation and help text even though it was deleted. Need to fix this
in 0.21 in a separate PR.
2021-09-04 19:34:14 +00:00
Samuel Dobson
d5d0a5c604
Merge bitcoin/bitcoin#17526: Add Single Random Draw as an additional coin selection algorithm
3633b667ff Use SelectCoinsSRD if it has less waste (Andrew Chow)
8bf789b4b4 Add SelectCoinsSRD function (Andrew Chow)
2ad3b5d2ad tests: wallet_basic lock needed unspents (Andrew Chow)
b77885f13e tests: wallet_txn explicilty specify inputs (Andrew Chow)
59ba7d2861 tests: rpc_fundrawtx better test for UTXO inclusion with include_unsafe (Andrew Chow)
a165bfbe44 tests: rpc_fundrawtx use specific inputs for unavailable change test (Andrew Chow)
df765a484d tests: rpc_fundrawtx lock to UTXO types (Andrew Chow)

Pull request description:

  To ease in the use of SRD as our fallback mechanism, this PR adds it as a secondary fallback algorithm in addition to the knapsack solver. Since #22009, the solution with the least waste will be chosen. This pattern is continued with SRD simply being another solution whose waste is compared.

ACKs for top commit:
  glozow:
    reACK 3633b66 via `git range-diff  981b9d1...3633b66`, thanks for taking the suggestions
  laanwj:
    Concept and code review ACK 3633b667ff

Tree-SHA512: 895659f553fea2230990136565bdf18b1328de8b0ce47f06b64bb4d69301f6dd68cb38debe5c24fb6de1317b735fc020a987c541f00bbea65229de47e53adf92
2021-09-03 22:45:48 +12:00
Andrew Chow
2ad3b5d2ad tests: wallet_basic lock needed unspents
To avoid accidentally spending UTXOs that are needed later in the test,
lock those UTXOs after they're creation.
2021-09-23 13:33:25 -04:00
MarcoFalke
fa0b916971
scripted-diff: Use generate* from TestFramework
-BEGIN VERIFY SCRIPT-
 sed --regexp-extended -i \
     's/((self\.)?(nodes\[[^]]+\]|[a-z_]*(wallet|node)[0-9a-z_]*))\.(generate(|toaddress|block|todescriptor)(\(|, ))/self.\5\1, /g' \
     $(git grep -l generate ./test | grep -v 'test_framework/' | grep -v 'feature_rbf')
-END VERIFY SCRIPT-
2021-09-02 10:34:35 +02:00
Russell Yanofsky
b11a195ef4 refactor: Detach wallet transaction methods (followup for move-only)
Followup to commit "MOVEONLY: CWallet transaction code out of
wallet.cpp/.h" that detaches and renames some CWalletTx methods, making
into them into standalone functions or CWallet methods instead.

There are no changes in behavior and no code changes that aren't purely
mechanical. It just gives spend and receive functions more consistent
names and removes the circular dependencies added by the earlier
MOVEONLY commit.

There are also no comment or documentation changes. Removed comments
from transaction.h are just migrated to spend.h, receive.h, and
wallet.h.
2021-09-01 02:22:58 -05:00
Andrew Poelstra
b3bba59059 Merge 0553d75268 into merged_master (Bitcoin PR bitcoin/bitcoin#22154) 2021-07-29 02:50:04 +00:00
Andrew Poelstra
01b1d5f844 Merge c5ee0cc11a into merged_master (Bitcoin PR bitcoin/bitcoin#21989) 2021-07-19 13:07:08 +00:00
Andrew Poelstra
9c4837db05 Merge adf7843410 into merged_master (Bitcoin PR bitcoin/bitcoin#21786) 2021-07-08 02:57:17 +00:00
Andrew Poelstra
990e799b8f Merge 8e69370b15 into merged_master (Bitcoin PR #21712) 2021-06-30 18:15:06 +00:00
Andrew Poelstra
d39d57c704 Merge 1c7be9ab90 into merged_master (Bitcoin PR #20286)
I hate this PR.
2021-06-28 21:30:17 +00:00
Andrew Chow
87a0e7a3b7 Disallow bech32m addresses for legacy wallet things
We don't want the legacy wallet to ever have bech32m addresses so don't
allow importing them. This includes addmultisigaddress as that is a
legacy wallet only RPC

Additionally, bech32m multisigs are not available yet, so disallow them
in createmultisig.
2021-06-22 21:57:04 -04:00
Andrew Chow
d8fa5c1458 Use createtx array outputs 2021-06-22 14:42:19 -04:00
Andrew Poelstra
d6c85c5620 Merge 4b15ffe991 into merged_master (Bitcoin PR #20832) 2021-06-18 20:35:42 +00:00
Andrew Poelstra
27930edc9c Merge 4a540683ec into merged_master (Bitcoin PR #20813) 2021-06-16 14:11:07 +00:00
Andrew Poelstra
c8d2647081 Merge 38176dc665 into merged_master (Bitcoin PR #20573) 2021-06-13 21:04:50 +00:00
Kiminuo
bfa9309ad6 Use COINBASE_MATURITY constant in functional tests. 2021-05-31 07:32:28 +02:00
Jon Atack
847288df07
test: fee rate values that cannot be represented as sat/vB 2021-05-09 12:50:04 +02:00
Jon Atack
06a90fa038
rpc: for sat/vB fee rates, limit ParseFixedPoint decimals to 3 2021-05-09 12:50:02 +02:00
Jon Atack
b503327597
test: type error and out of range fee rates where missing 2021-05-09 12:49:56 +02:00
Jon Atack
c5fd4344f7
test: explicit fee rates with invalid amounts 2021-05-09 12:49:47 +02:00
Andrew Poelstra
d3321390c2 Merge ca4a784942 into merged_master (Bitcoin PR #20410) 2021-05-07 20:56:02 +00:00
Jon Atack
ea6f76b66e
test: improve zero-value explicit fee rate coverage 2021-05-06 09:06:27 +02:00
João Barbosa
44dab423eb qa: Test default include_mempool value of gettxout 2021-04-16 23:44:49 +01:00
Michael Dietz
085b3a7299
rpc: deprecate addresses and reqSigs from rpc outputs
1) add a new sane "address" field (for outputs that have an
   identifiable address, which doesn't include bare multisig)
2) with -deprecatedrpc: leave "reqSigs" and "addresses" intact
   (with all weird/wrong behavior they have now)
3) without -deprecatedrpc: drop "reqSigs" and "addresses" entirely,
   always.
2021-03-23 10:51:43 -04:00
Bezdrighin
8f0b64fb51 Better error messages for invalid addresses
This commit addresses #20809.

We add an additional 'error' property in the result of 'validateaddress' in case the address is not valid that gives a short description of why the address in invalid. We also change the error message returned by 'getaddressinfo' in case the address is invalid.
2021-01-24 02:44:53 +01:00
MarcoFalke
fa0074e2d8
scripted-diff: Bump copyright headers
-BEGIN VERIFY SCRIPT-
./contrib/devtools/copyright_header.py update ./
-END VERIFY SCRIPT-
2020-12-31 09:45:41 +01:00
Jon Atack
6fa72ceb80
test: add coverage for passing fee rate as a string 2020-12-04 22:35:31 +01:00
Andrew Poelstra
5b89a9fc92 Merge 80e32e120e into merged_master (Bitcoin PR #20305) 2020-12-02 17:53:59 +00:00
Andrew Poelstra
2577c79f78 Merge 5d32009f1a into merged_master (Bitcoin PR #20220) 2020-12-02 03:05:14 +00:00
Andrew Poelstra
6f267e338a Merge 47fc883106 into merged_master (Bitcoin PR #19967) 2020-12-01 14:36:58 +00:00
Andrew Poelstra
33a0d5e270 Merge 301959fa74 into merged_master (Bitcoin PR #20043) 2020-11-30 02:42:44 +00:00
Andrew Poelstra
1b85209c18 Merge 1769828684 into merged_master (Bitcoin PR #19501)
Adds "verbose" flag to a bunch of RPC that pass through to SendMoney. I also
added it to sendtomainchain and destroyamount.
2020-11-30 02:17:54 +00:00
Andrew Poelstra
15764533c6 Merge c91f955f44 into merged_master (Bitcoin PR #19887) 2020-11-28 23:42:28 +00:00
Andrew Poelstra
afe472121a Merge a1d14f522c into merged_master (Bitcoin PR #19671) 2020-11-28 19:48:53 +00:00
Andrew Poelstra
5f6eb8ee3f Merge f98872f127 into merged_master (Bitcoin PR #18244) 2020-11-28 18:55:44 +00:00