Commit graph

216 commits

Author SHA1 Message Date
ivanlele
d6516d7f3a
Merge 589b56192f into merged_master (Bitcoin PR bitcoin/bitcoin#32292) 2026-07-13 14:15:43 +00:00
ivanlele
aa41e29f97
Merge 3a29ff5dea into merged_master (Bitcoin PR bitcoin/bitcoin#30463) 2026-03-09 16:54:19 +00:00
ivanlele
12bbc09a42
Merge 4ff42762fd into merged_master (Bitcoin PR bitcoin/bitcoin#28336) 2026-02-20 09:34:54 +00:00
ivanlele
b92a1dd970
Merge c8e3978114 into merged_master (Bitcoin PR bitcoin/bitcoin#27307) 2026-02-17 10:01:46 +00:00
ivanlele
8866e81d96
Merge bef99176e6 into merged_master (Bitcoin PR #27114) 2026-02-13 17:25:19 +00:00
Byron Hambly
c99f0e4a16
Merge dd391944dc into merged_master (Bitcoin PR bitcoin/bitcoin#28863) 2025-11-17 20:53:12 +02:00
Byron Hambly
f6bbbcaf08
Merge 2a349f9ea5 into merged_master (Bitcoin PR bitcoin/bitcoin#28264) 2025-11-05 14:53:04 +02:00
Tom Trevethan
a078db463a reenabled test with sendall fix and policy asset changes 2025-10-14 00:00:05 +01:00
Byron Hambly
1889e2fd62 Merge c00bc63061 into merged_master (Bitcoin PR bitcoin/bitcoin#28288) 2025-07-05 07:41:44 +02:00
Byron Hambly
59fd51205b Merge eb95368e0c into merged_master (Bitcoin PR bitcoin/bitcoin#28166) 2025-07-03 14:18:25 +02:00
Byron Hambly
c862d3cdba Merge 7794d9d93f into merged_master (Bitcoin PR bitcoin/bitcoin#27735) 2025-06-24 14:48:59 +02:00
Byron Hambly
1025535549 Merge da9f62f912 into merged_master (Bitcoin PR bitcoin/bitcoin#26094) 2025-05-15 13:12:44 +02:00
Byron Hambly
5b48391c7f Merge 539452242e into merged_master (Bitcoin PR bitcoin/bitcoin#26733) 2025-05-15 13:11:08 +02:00
Martin Zumsande
cf034172bf
test: fix another intermittent failure in wallet_basic.py
During init, the test framework will start using rpc after the
mempool was loaded. It will not wait for postInitProcess or
outstanding transactionAddedToMempool notifications, leading to
a possible race, in which listunspent is being called while the
tx is still in Inactive status. Prevent this by processing
outstanding notifications.

Github-Pull: #32483
Rebased-From: e7ad86e1ca3b0b2f2795e91c2f9959486c67dd90
2025-05-14 13:26:53 +01:00
Martin Zumsande
c966158426
test: Fix intermittent failure in wallet_basic.py
There could be a race with outstanding TxAddedToMempool notifications
being applied to the soon-to-be created wallet.

Fixes an intermittent timeout reproducable by adding a sleep to
AddToWallet.

Github-Pull: #32483
Rebased-From: 07350e204dedfba20da461d9cdcd469dc95e01c3
2025-05-14 13:26:48 +01:00
Byron Hambly
d69d8c5c42 Merge 73a9892bce into merged_master (Bitcoin PR bitcoin/bitcoin#26514) 2025-04-10 07:55:52 +02:00
Byron Hambly
757fcf42b4 Merge 635f1900d0 into merged_master (Bitcoin PR bitcoin/bitcoin#26884)
Adds a FIXME for the spendzeroconfchange stuff in wallet_basic.py
2025-04-03 09:30:40 +02:00
Byron Hambly
b4405ba453 Merge e9262ea32a into merged_master (Bitcoin PR bitcoin/bitcoin#26750) 2025-03-31 16:37:52 +02:00
Byron Hambly
0b0d5d214e Merge 8597260872 into merged_master (Bitcoin PR bitcoin/bitcoin#26480) 2025-03-04 10:42:21 +02:00
Byron Hambly
ca0a68b350
Merge UP TO 551c8e9526 into merged_master (UP TO bitcoin/bitcoin#26349)
Includes FIXMEs for a few functional tests
2025-02-05 09:50:17 +02:00
Byron Hambly
c1cfac4527 Merge 2557429d2b into merged_master (Bitcoin PR bitcoin/bitcoin#26037) 2024-11-26 13:01:46 +02:00
Byron Hambly
01c6b7b6a6 Merge d16ef40441 into merged_master (Bitcoin PR bitcoin/bitcoin#25955) 2024-11-25 14:36:23 +02:00
Byron Hambly
19eece4f40 Merge 3c1e75ef60 into merged_master (Bitcoin PR bitcoin/bitcoin#25865) 2024-11-21 14:58:09 +02:00
Byron Hambly
d6e6f35037 Merge c336f813b3 into merged_master (Bitcoin PR bitcoin/bitcoin#25504) 2024-11-02 17:28:21 +02:00
Byron Hambly
66e36f95c5 Merge 47dad42833 into merged_master (Bitcoin PR bitcoin/bitcoin#25629) 2024-10-17 15:04:30 +02:00
James Dorfman
5d43651b1c Merge 9c55091be2 into merged_master (Bitcoin PR bitcoin/bitcoin#25535) 2024-10-09 05:56:27 +00:00
Hennadii Stepanov
a0473442d1
scripted-diff: Add __file__ argument to BitcoinTestFramework.init()
-BEGIN VERIFY SCRIPT-
sed -i -e 's/\s*().main\s*()/(__file__).main()/' $(git ls-files test/functional/*.py)
sed -i -e 's/def __init__(self)/def __init__(self, test_file)/' test/functional/test_framework/test_framework.py
-END VERIFY SCRIPT-
2024-07-16 22:06:47 +01:00
Ava Chow
4ff42762fd
Merge bitcoin/bitcoin#28336: rpc: parse legacy pubkeys consistently with specific error messages
98570fe29b test: add coverage for parsing cryptographically invalid pubkeys (Sebastian Falbesoner)
c740b154d1 rpc: use `HexToPubKey` helper for all legacy pubkey-parsing RPCs (Sebastian Falbesoner)
100e8a75bf rpc: check and throw specific pubkey parsing errors in `HexToPubKey` (Sebastian Falbesoner)

Pull request description:

  Parsing legacy public keys can fail for three reasons (in this order):
  - pubkey is not in hex
  - pubkey has an invalid length (not 33 or 65 bytes for compressed/uncompressed, respectively)
  - pubkey is crytographically invalid, i.e. is not on curve (`CPubKey.IsFullyValid()` check)

  Many RPCs currently perform these checks manually with different error messages, even though we already have a `HexToPubKey` helper. This PR puts all three checks in this helper (the length check was done on the call-sites before), adds specific error messages for each case, and consequently uses it for all RPCs that parse legacy pubkeys. This leads to deduplicated code and also to more consistent and detailed error messages for the user.

  Affected RPC calls are `createmultisig`, `addmultisigaddress`, `importpubkey`, `importmulti`, `fundrawtransaction`, `walletcreatefundedpsbt`, `send` and `sendall`.

  Note that the error code (-5 a.k.a. `RPC_INVALID_ADDRESS_OR_KEY`) doesn't change in any of the causes, so the changes are not breaking RPC API compatibility. Only the messages are more specific.

  The last commits adds test coverage for the cryptographically invalid (not-on-curve) pubkey case which wasn't exercised before.

ACKs for top commit:
  stratospher:
    tested ACK 98570fe.
  davidgumberg:
    ACK https://github.com/bitcoin/bitcoin/pull/28336/commits/98570fe29bb08d7edc48011aa6b9731c6ab4ed2e
  Eunovo:
    Tested ACK https://github.com/bitcoin/bitcoin/pull/28336/commits/98570fe29bb08d7edc48011aa6b9731c6ab4ed2e
  achow101:
    ACK 98570fe29b

Tree-SHA512: cfa474176e95b5b18f3a9da28fdd9e87195cd58994c1331198f2840925fff322fd323a6371feab74a1b32e4b9ea58a6dc732fa751b4cdd45402c1029af609ece
2024-05-08 17:52:58 -04:00
James Dorfman
100d6e7c28 Merge f66c827c2d into merged_master (Bitcoin PR bitcoin/bitcoin#24502)
Changed a bech32m address in the wallet_basic test to blech32m (for elements).
Also changed an error message in the wallet to say "blech32m" instead of "bech32m".
2024-04-08 04:17:28 +00:00
Ryan Ofsky
c8e3978114
Merge bitcoin/bitcoin#27307: wallet: track mempool conflicts with wallet transactions
5952292133 wallet, rpc: show mempool conflicts in `gettransaction` result (ishaanam)
54e07ee22f wallet: track mempool conflicts (ishaanam)
d64922b590 wallet refactor: use CWalletTx member functions to determine tx state (ishaanam)
ffe5ff1fb6 scripted-diff: wallet: s/TxStateConflicted/TxStateBlockConflicted (ishaanam)
180973a941 test: Add tests for wallet mempool conflicts (ishaanam)

Pull request description:

  The `mempool_conflicts` variable is added to `CWalletTx`, it is a set of txids of txs in the mempool conflicting with the wallet tx or a wallet tx's parent. This PR only changes how mempool-conflicted txs are dealt with in memory.

  `IsSpent` now returns false for an output being spent by a mempool conflicted transaction where it previously returned true.

  A txid is added to `mempool_conflicts` during  `transactionAddedToMempool`. A txid is removed from `mempool_conflicts` during  `transactionRemovedFromMempool`.

  This PR also adds a `mempoolconflicts` field to the `gettransaction` wallet RPC result.

  Builds on #27145
  Second attempt at #18600

ACKs for top commit:
  achow101:
    ACK 5952292133
  ryanofsky:
    Code review ACK 5952292133. Just small suggested changes since last review
  furszy:
    ACK 59522921

Tree-SHA512: 615779606723dbb6c2e302681d8e58ae2052ffee52d721ee0389746ddbbcf4b4c4afacf01ddf42b6405bc6f883520524186a955bf6b628fe9b3ae54cffc56a29
2024-03-27 12:45:08 -04:00
ishaanam
5952292133 wallet, rpc: show mempool conflicts in gettransaction result 2024-03-20 15:05:37 -04:00
brunoerg
c985eb854c test: add option to speed up tx relay/mempool sync
when `self.noban_tx_relay=True`, the following flag
`-whitelist=noban,in,out@127.0.0.1`is added to `extra_args`
to speed up tx relay/mempool sync.
2024-02-28 10:05:56 -03:00
Sebastian Falbesoner
98570fe29b test: add coverage for parsing cryptographically invalid pubkeys 2024-02-09 13:35:23 +01:00
Sebastian Falbesoner
c740b154d1 rpc: use HexToPubKey helper for all legacy pubkey-parsing RPCs
This deduplicates code and leads to more consistent and detailed error
messages. Affected are legacy import RPCs (`importpubkey`,
`importmulti`) and other ones where solving data can be provided
(`fundrawtransaction`, `walletcreatefundedpsbt`, `send`, `sendall`).
2024-02-09 13:35:23 +01:00
ismaelsadeeq
8dec9c560b wallet, mempool: propagete checkChainLimits error message to wallet
Update CheckPackageLimits to use util::Result to pass the error message
instead of out parameter.

Also update test to reflect the error message from `CTxMempool`
`CheckPackageLimits` output.
2023-12-17 21:13:44 +01:00
Sebastian Falbesoner
73a339abc3 test: refactor: support sending funds with outpoint result
This commit introduces a helper `create_outpoints` to execute the
`send` RPC and immediately return the target address outpoints as UTXO
dictionary in the common format, making the tests more readable and
avoiding unnecessary duplication.
2023-10-24 11:13:51 +02:00
Byron Hambly
1c43dde820 Merge 9d22dbe2e1 into merged_master (Bitcoin PR bitcoin/bitcoin#24198) 2023-10-13 13:20:16 +00:00
brunoerg
452c094449 test: fix 'unknown named parameter' test in wallet_basic
Fixes loop when testing an unknown named parameter.
2023-08-21 20:59:15 -03:00
Jon Atack
90c8f79e94 test: remove redundant test values
as they are parsed identically.

See AmountFromValue() / ParseFixedPoint() / UniValue#getValStr()
2023-07-27 06:54:32 -06:00
Byron Hambly
bd68371fb6 Merge ffdab41f94 into merged_master (Bitcoin PR bitcoin/bitcoin#23474) 2023-05-26 10:32:04 +00:00
MarcoFalke
ffffe622e9
test: Move test_chain_listunspent wallet check from mempool_packages to wallet_basic 2023-05-26 09:02:55 +02: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
Andrew Chow
da9f62f912
Merge bitcoin/bitcoin#26094: rpc: Return block hash & height in getbalances, gettransaction and getwalletinfo
710b83938a rpc: return block hash & height in getbalances, gettransaction & getwalletinfo JSONs (Harris)

Pull request description:

  Reopens #18570 and closes #18567.
  I have rebased the original PR.
  Not sure why the original got closed as it was about to get merged.

ACKs for top commit:
  achow101:
    ACK 710b83938a

Tree-SHA512: d4478d990be98b1642e9ffb2930987f4a224e8bd64e2e35a5dda927a54c509ec9d712cd0eac35dc2bb89f00a1678e530ce14d7445f1dd93aa3a4cce2bc9b130d
2023-05-02 11:50:45 -04:00
Andrew Chow
539452242e
Merge bitcoin/bitcoin#26733: test: Add test for sendmany rpc that uses subtractfeefrom parameter
057057a2d7 Add test for `sendmany` rpc that uses `subtractfeefrom` parameter (Yusuf Sahin HAMZA)

Pull request description:

  This PR adds test that uses `sendmany` rpc to send **BTC** to multiple addresses using `subtractfeefrom` parameter, then checks receiver addresses balances to make sure fees are subtracted correctly.

ACKs for top commit:
  achow101:
    ACK 057057a2d7

Tree-SHA512: 51167120d489f0ff7b8b9855424d07cb55a8965984f904643cddf45e7a08c350eaded498c350ec9c660edf72c2f128ec142347c9c79d5043d9f6cd481b15cd7e
2023-05-01 09:28:06 -04:00
Byron Hambly
b708aecb74 Merge 571bb94dfb into merged_master (Bitcoin PR bitcoin/bitcoin#23123) 2023-04-28 13:31:37 +00:00
Harris
710b83938a rpc: return block hash & height in getbalances, gettransaction & getwalletinfo JSONs
Co-authored-by: Aurèle Oulès <aurele@oules.com>
2023-04-26 16:07:47 +02: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