aboutsummaryrefslogtreecommitdiff
path: root/test/functional/wallet_fundrawtransaction.py
AgeCommit message (Collapse)Author
2024-02-28test: add option to speed up tx relay/mempool syncbrunoerg
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-01-19test: add tests for fundrawtx and sendmany rpcsjosibake
If the serialized transaction passed to `fundrawtransaction` contains duplicates, they will be deserialized and added to the transaction. Add a test to ensure this behavior is not changed during the refactor. A user can pass any number of duplicated and unrelated addresses as an SFFO argument to `sendmany` and the RPC will not throw an error (note, all the rest of the RPCs which take SFFO as an argument will error if the user passes duplicates or specifies outputs not present in the transaction). Add a test to ensure this behavior is not changed during the refactor.
2023-10-24test: refactor: support sending funds with outpoint resultSebastian Falbesoner
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-19Merge bitcoin/bitcoin#28617: test: Add Wallet Unlock Context Managerfanquake
004903ebade38ba47c5ddc17b756d605b963528e test: Add Wallet Unlock Context Manager (Brandon Odiwuor) Pull request description: Fixes #28601, see https://github.com/bitcoin/bitcoin/pull/28403#discussion_r1325426430 Add Context Manager to manage the locking and unlocking of locked wallets with a passphrase during testing. ACKs for top commit: kevkevinpal: lgtm ACK [004903e](https://github.com/bitcoin/bitcoin/pull/28617/commits/004903ebade38ba47c5ddc17b756d605b963528e) maflcko: lgtm ACK 004903ebade38ba47c5ddc17b756d605b963528e Tree-SHA512: ab234c167e71531df0d974ff9a31d444f7ce2a1d05aba5ea868cc9452f139845eeb24ca058d88f058bc02482b762adf2d99e63a6640b872cc71a57a0068abfe8
2023-10-10test: Add Wallet Unlock Context ManagerBrandon Odiwuor
Add Context Manager to manage wallet locking/unlocking with passphrase
2023-10-05test: Use feerate higher than minrelay fee in wallet_fundrawAndrew Chow
The external input weight test in wallet_fundrawtransaction.py made transactions at the minimum relay fee. However due to ECDSA sometimes making a shorter signature than expected, the size estimate (and therefore the funded fee) ends up being a little bit too low, which results in the final transaction being under the min relay fee. We can compensate for this by just using a feerate higher than the minrelayfee as the actual feerate itself does not matter in this test.
2023-10-05test: Bump walletpassphrase timeouts to avoid intermittent issuesMarcoFalke
2023-09-06test: remove unnecessary finalizepsbt rpc callsismaelsadeeq
2023-08-10test: locked_wallet, skip default fee estimationfurszy
Same as we do with the nodes default wallets. No test case on this file is meant to exercise fee estimation.
2023-08-01Merge bitcoin/bitcoin#28166: test, rpc: invalid sighashtype coveragefanquake
90c8f79e945863f3818748b86572948d1558aec3 test: remove redundant test values (Jon Atack) c3f203387df60c596a1e416658d87d68b85adbf2 test: use common assert_signing_completed_successfully helper (Jon Atack) 647d95aae9720543c2c9c46c70191e6f9f775d66 test: add coverage for passing an invalid sighashtype (Jon Atack) Pull request description: Add test coverage for passing an invalid sighashtype to RPCs signrawtransactionwithwallet, signrawtransactionwithkey, walletprocesspsbt, and descriptorprocesspsbt. ACKs for top commit: MarcoFalke: lgtm ACK 90c8f79e945863f3818748b86572948d1558aec3 🎥 brunoerg: light crACK 90c8f79e945863f3818748b86572948d1558aec3 Tree-SHA512: 3861658487edd0d9a377390acf3d43f45c3dd9e324894f0fdb8f5312b618301a55479b1f70c61daee0b20785e768ffde6fa5abe6af190b73c0d0e017f3976704
2023-07-27test: remove redundant test valuesJon Atack
as they are parsed identically. See AmountFromValue() / ParseFixedPoint() / UniValue#getValStr()
2023-07-26test: remove unused `totalOut` codebrunoerg
In `wallet_fundrawtransaction`, `totalOut` is used in some functions to check if the change is correct. In other ones, it has been created but never used.
2023-07-26test: remove unecessary `decoderawtransaction` callsbrunoerg
In `wallet_fundrawtransaction`, there are some unecessary variables/calls to `decoderawtransaction`. They have not been used.
2023-07-24test: create wallet specific for test_locked_wallet casefurszy
Other tests are also relying on the node1 default wallet, which thanks to 'test_locked_wallet' is encrypted. And can only be accessed within a specific timeframe (100ms) set internally by the same test. This make other tests susceptible to races. They can only perform their operations successfully within the specified time. This can be seen running the test in valgrind, where other test cases fail due the wallet re-locking itself after the 100ms.
2023-06-19test: refactor: introduce `generate_keypair` helper with WIF supportSebastian Falbesoner
In functional tests it is a quite common scenario to generate fresh elliptic curve keypairs, which is currently a bit cumbersome as it involves multiple steps, e.g.: privkey = ECKey() privkey.generate() privkey_wif = bytes_to_wif(privkey.get_bytes()) pubkey = privkey.get_pubkey().get_bytes() Simplify this by providing a new `generate_keypair` helper function that returns the private key either as `ECKey` object or as WIF-string (depending on the boolean `wif` parameter) and the public key as byte-string; these formats are what we mostly need (currently we don't use `ECPubKey` objects from generated keypairs anywhere). With this, most of the affected code blocks following the pattern above can be replaced by one-liners, e.g.: privkey, pubkey = generate_keypair(wif=True) Note that after this commit, the only direct uses of `ECKey` remain in situations where we want to set the private key explicitly, e.g. in MiniWallet (test/functional/test_framework/wallet.py) or the test for the signet miner script (test/functional/tool_signet_miner.py).
2023-05-03test: Update python tests to use named parameters instead of options objectsRyan Ofsky
2023-01-11Wallet/RPC: Allow specifying min & max chain depth for inputs used by fund callsJuan Pablo Civile
Enables users to craft BIP-125 replacements with changes to the output list, ensuring that if additional funds are needed they will be added.
2023-01-03Merge bitcoin/bitcoin#26661: wallet: Coin Selection, return accurate error ↵Andrew Chow
messages 76dc547ee7b05864e7b1b6c55fc0301d47aa3a15 gui: create tx, launch error dialog if backend throws runtime_error (furszy) f4d79477ff0946b0bd340ade9251fa38e3b95dd7 wallet: coin selection, add duplicated inputs checks (furszy) 0aa065b14e67592d5be8f46ebbe5d59a083ff0a5 wallet: return accurate error messages from Coin Selection (furszy) 7e8340ab1a970a14e180b1fcf420b46a5657b062 wallet: make SelectCoins flow return util::Result (furszy) e5e147fe97f706e82bc51358f8bdc355f355be57 wallet: refactor eight consecutive 'AttemptSelection' calls into a loop (furszy) Pull request description: Work decoupled from #25806, which cleanup and improves the Coin Selection flow further. Adding the capability to propagate specific error messages from the Coin Selection process to the user. Instead of always returning the general "Insufficient funds" message which is not always accurate to what happened internally. Letting us instruct the user how to proceed under certain circumstances. The following error messages were added: 1) If the selection result exceeds the maximum transaction weight, we now will return: -> "The inputs size exceeds the maximum weight. Please try sending a smaller amount or manually consolidating your wallet's UTXOs". 2) If the user pre-selected inputs and disallowed the automatic coin selection process (no other inputs are allowed), we now will return: -> "The preselected coins total amount does not cover the transaction target. Please allow other inputs to be automatically selected or include more coins manually". 3) The double-counted preset inputs during Coin Selection error will now throw an "internal bug detected" message instead of crashing the node. The essence of this work comes from several comments: 1. https://github.com/bitcoin/bitcoin/pull/26560#discussion_r1037395665 2. https://github.com/bitcoin/bitcoin/pull/25729#discussion_r940619491 3. https://github.com/bitcoin/bitcoin/pull/25269#pullrequestreview-1135240825 4. https://github.com/bitcoin/bitcoin/issues/23144 (which is connected to #24845) ACKs for top commit: ishaanam: crACK 76dc547ee7b05864e7b1b6c55fc0301d47aa3a15 achow101: ACK 76dc547ee7b05864e7b1b6c55fc0301d47aa3a15 aureleoules: ACK 76dc547ee7b05864e7b1b6c55fc0301d47aa3a15 theStack: ACK 76dc547ee7b05864e7b1b6c55fc0301d47aa3a15 :city_sunrise: Tree-SHA512: 9de30792d7a5849cae77747aa978e70390b66ee9d082779a56088a024f82e725b0af050e6603aece0ac8229f6d73bc471ba97b4ab69dc7eddf419f5f56ae89a5
2022-12-24scripted-diff: Bump copyright headersHennadii Stepanov
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT- Commits of previous years: - 2021: f47dda2c58b5d8d623e0e7ff4e74bc352dfa83d7 - 2020: fa0074e2d82928016a43ca408717154a1c70a4db - 2019: aaaaad6ac95b402fe18d019d67897ced6b316ee0
2022-12-21wallet: return accurate error messages from Coin Selectionfurszy
and not the general "Insufficient funds" when the wallet actually have funds. Two new error messages: 1) If the selection result exceeds the maximum transaction weight, we now will return: "The inputs size exceeds the maximum weight". 2) If the user preselected inputs and disallowed the automatic coin selection process (no other inputs are allowed), we now will return: "The preselected coins total amount does not cover the transaction target".
2022-12-19test: speed up wallet_fundrawtransaction.py and wallet_sendall.pykdmukai
2022-12-09test: Move rpc_fundrawtransaction.py to wallet_fundrawtransaction.pyMarcoFalke