aboutsummaryrefslogtreecommitdiff
path: root/test/functional/wallet_bumpfee.py
AgeCommit message (Collapse)Author
2022-11-10test: Remove wallet option from non-wallet testsMacroFake
Review note: The changes are complete, because self.options.descriptors is set to None in parse_args (test_framework.py). A value of None implies -disablewallet, see the previous commit. So if a call to add_wallet_options is missing, it will lead to a test failure when the wallet is compiled in.
2022-09-19test: check that bumping tx with already spent coin failsSebastian Falbesoner
2022-08-30test: use `sendall` when emptying walletbrunoerg
2022-08-24Merge bitcoin/bitcoin#25865: test: speedup wallet tests by whitelisting ↵MacroFake
peers (immediate tx relay) b21e522ce47a13e024488e43f1cd33a0f1769197 test: speedup wallet tests by whitelisting peers (immediate tx relay) (Sebastian Falbesoner) Pull request description: In the course of testing #25297 by running all wallet-related functional tests (see https://github.com/bitcoin/bitcoin/pull/25297#issuecomment-1203365589), I noticed that the run-time of those tests vary a lot between runs, in fact too much for a useful comparison. This PR fixes this by making the tests both more deterministic and also faster, using the good ol' immediate tx relay trick (parameter `-whitelist=noban@127.0.0.1`). master branch: ``` wallet_abandonconflict.py --descriptors | ✓ Passed | 7 s wallet_abandonconflict.py --legacy-wallet | ✓ Passed | 23 s wallet_balance.py --descriptors | ✓ Passed | 17 s wallet_balance.py --legacy-wallet | ✓ Passed | 21 s wallet_basic.py --descriptors | ✓ Passed | 32 s wallet_basic.py --legacy-wallet | ✓ Passed | 56 s wallet_bumpfee.py --descriptors | ✓ Passed | 44 s wallet_bumpfee.py --legacy-wallet | ✓ Passed | 45 s wallet_groups.py --descriptors | ✓ Passed | 89 s wallet_groups.py --legacy-wallet | ✓ Passed | 94 s wallet_hd.py --descriptors | ✓ Passed | 7 s wallet_hd.py --legacy-wallet | ✓ Passed | 13 s wallet_importdescriptors.py --descriptors | ✓ Passed | 26 s wallet_listreceivedby.py --descriptors | ✓ Passed | 28 s wallet_listreceivedby.py --legacy-wallet | ✓ Passed | 18 s ALL | ✓ Passed | 520 s (accumulated) Runtime: 526 s ``` PR branch: ``` wallet_abandonconflict.py --descriptors | ✓ Passed | 7 s wallet_abandonconflict.py --legacy-wallet | ✓ Passed | 11 s wallet_balance.py --descriptors | ✓ Passed | 8 s wallet_balance.py --legacy-wallet | ✓ Passed | 8 s wallet_basic.py --descriptors | ✓ Passed | 29 s wallet_basic.py --legacy-wallet | ✓ Passed | 36 s wallet_bumpfee.py --descriptors | ✓ Passed | 39 s wallet_bumpfee.py --legacy-wallet | ✓ Passed | 32 s wallet_groups.py --descriptors | ✓ Passed | 39 s wallet_groups.py --legacy-wallet | ✓ Passed | 41 s wallet_hd.py --descriptors | ✓ Passed | 8 s wallet_hd.py --legacy-wallet | ✓ Passed | 11 s wallet_importdescriptors.py --descriptors | ✓ Passed | 17 s wallet_listreceivedby.py --descriptors | ✓ Passed | 7 s wallet_listreceivedby.py --legacy-wallet | ✓ Passed | 9 s ALL | ✓ Passed | 302 s (accumulated) Runtime: 309 s ``` Note that an alternative approach could be to whitelist peers by default for nodes in the functional test framework and only enable the trickle relay for the few tests where it's really needed. ACKs for top commit: naumenkogs: utACK b21e522ce47a13e024488e43f1cd33a0f1769197 Tree-SHA512: ac3c8f8f5a401d1b6af60ece9c77e72449f18920c2cb4a1bd65fb4d62cf428779ebf4e1d29009a882977b2252922df4e7183541e0da8de932f8cd479149e8a86
2022-08-19test, bumpfee: Check that psbtbumpfee can bump txs with external inputsAndrew Chow
2022-08-18test: speedup wallet tests by whitelisting peers (immediate tx relay)Sebastian Falbesoner
2022-07-12scripted-diff: [test] Rename BIP125_SEQUENCE_NUMBER to MAX_BIP125_RBF_SEQUENCEMacroFake
-BEGIN VERIFY SCRIPT- sed -i 's:BIP125_SEQUENCE_NUMBER:MAX_BIP125_RBF_SEQUENCE:g' $(git grep -l BIP125_SEQUENCE_NUMBER ./test) -END VERIFY SCRIPT-
2022-03-25[wallet] randomly generate change targetsglozow
If the wallet always chooses 1 million sats as its change target, it is easier to fingerprint transactions created by the Core wallet.
2021-11-17test: refactor: take use of `create_block` txlist parameterSebastian Falbesoner
Passing a list of transactions `txlist` to `create_block` appends them to the block, hence we don't need to do that manually anymore. The merkle root calculation can also be removed, since this is done in the end of the helper.
2021-11-16Merge bitcoin/bitcoin#23474: test: scripted-diff cleanups after generate* ↵fanquake
changes fac23c211407a77af82bb1491c48c8d37022c8b3 scripted-diff: Bump copyright headers (MarcoFalke) fa974f1f1417a536636347072e86bcb54a4c909c scripted-diff: Remove redundant sync_all and sync_blocks (MarcoFalke) fad13991aea6463ecf07dd907de1c1b23837d7e7 test: Properly set sync_fun in NodeNetworkLimitedTest (MarcoFalke) faeff577093c4de9eec9491486a2c3766d46dae6 test: Use 4 spaces for indentation (MarcoFalke) Pull request description: Some cleanups after commit 94db963de501e4aba6e5d8150a01ceb85753dee1 ACKs for top commit: fanquake: ACK fac23c211407a77af82bb1491c48c8d37022c8b3 Tree-SHA512: 5acfd5bb9679b41969d0fc6fc85801ccadcd6530ea692bac6352668e06fc7a9b0e1db3fd6fba435e84afe983d2eb07bd0a47c8364462bb7110004bd3d102b698
2021-11-12test: remove unnecessary block rehashing prior to solvingSebastian Falbesoner
Solving a block involves continously rehashing it, i.e. any extra calls to rehash it before are not necessary and can be dropped.
2021-11-10scripted-diff: Bump copyright headersMarcoFalke
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-10scripted-diff: Remove redundant sync_all and sync_blocksMarcoFalke
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-10-29test: Implicitly sync after generate*, unless opted outMarcoFalke
2021-10-15test: check that bumpfee RPC fails for txs with descendants in mempoolSebastian Falbesoner
This commit adds missing test coverage for the bumpfee RPC error "Transaction has descendants in the mempool", which is thrown if the bumped tx has descendants in the mempool and is _not_ connected to the bitcoin wallet. To achieve that, the test framework's MiniWallet is used.
2021-09-02scripted-diff: Use generate* from TestFrameworkMarcoFalke
-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-06-21test: introduce `tx_from_hex` helper for tx deserializationSebastian Falbesoner
`FromHex` is mostly used for transactions, so we introduce a shortcut `tx_from_hex` for `FromHex(CTransaction, hex_str)`.
2021-05-31Use COINBASE_MATURITY constant in functional tests.Kiminuo
2021-05-09test: fee rate values that cannot be represented as sat/vBJon Atack
2021-05-09test: type error and out of range fee rates where missingJon Atack
2021-05-09test: explicit fee rates with invalid amountsJon Atack
2021-05-06test: improve zero-value explicit fee rate coverageJon Atack
2021-03-23rpc: deprecate `addresses` and `reqSigs` from rpc outputsMichael Dietz
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-01-08Remove deprecated bumpfee behaviorAndrew Chow
2020-12-04test: add coverage for passing fee rate as a stringJon Atack
2020-11-20Update feeRate (BTC/kvB) to fee_rate (sat/vB) in wallet_bumpfeeJon Atack
as the feeRate argument should soon be deprecated. Also loosen one test (and a similar one) that caused a one-off CI failure with: expected message 'Insufficient total fee 0.00000141, must be at least 0.00001704 (oldFee 0.00000999 + incrementalFee 0.00000705)' actual message 'Insufficient total fee 0.00000141, must be at least 0.00001712 (oldFee 0.00001007 + incrementalFee 0.00000705)'
2020-11-12wallet: provide valid values if invalid estimate mode passedJon Atack
Co-authored-by: Murch <murch@murch.one>
2020-11-11wallet: remove redundant bumpfee fee_rate checksJon Atack
SetFeeEstimateMode() handles these checks now and provides a more actionable error message.
2020-11-11wallet: introduce fee_rate (sat/vB) param/optionJon Atack
Create a fee_rate (sat/vB) RPC param and replace overloading the conf_target and estimate_mode params in the following 6 RPCs with it: - sendtoaddress - sendmany - send - fundrawtransaction - walletcreatefundedpsbt - bumpfee In RPC bumpfee, the previously existing fee_rate remains but the unit is changed from BTC/kvB to sat/vB. This is a breaking change, but it should not be an overly risky one, as the units change by a factor of 1e5 and any fees specified in BTC/kvB after this commit will either be too low and raise an error or be 1 sat/vB and can be RBFed. Update the test coverage for each RPC. Co-authored-by: Murch <murch@murch.one>
2020-11-04Merge #20220: wallet, rpc: explicit fee rate follow-ups/fixes for 0.21Samuel Dobson
0be29000c011dec0722481dbebb159873da6fa54 rpc: update conf_target helps for correctness/consistency (Jon Atack) 778b9be40667876c705e586849ea9c9e44cf451c wallet, rpc: fix send subtract_fee_from_outputs help (Jon Atack) 603c0050837ec65765208dd54dde354145fbe098 wallet: add rpc send explicit fee rate coverage (Jon Atack) dd341e602d5160fc621c0299179b91403756b61d wallet: add sendtoaddress/sendmany explicit fee rate coverage (Jon Atack) 44e7bfa60313e4ae67da49e5ba4535038b71b453 wallet: add walletcreatefundedpsbt explicit fee rate coverage (Jon Atack) 6e1ea4273e52fdcd86c87628aa595c03a071ca8c test: refactor for walletcreatefundedpsbt fee rate coverage (Jon Atack) 3ac7b0c6f1c68e74a84d868a454f508bada6b09d wallet: fundrawtx fee rate coverage, fixup ParseConfirmTarget() (Jon Atack) 2d8eba8f8425a2515022d51f1f5b4911329fbf55 wallet: combine redundant bumpfee invalid params and args tests (Jon Atack) 1697a40b6f841a54ee0d9744ed7fd09034b0ddad wallet: improve bumpfee error/help, add explicit fee rate coverage (Jon Atack) fc5721723d34f76f9e1ffd2e31f274ea6b22f894 wallet: fix SetFeeEstimateMode() error message (Jon Atack) 052427eef1c9da84c474c5161b1910d3328ef0da wallet, bugfix: fix bumpfee with explicit fee rate modes (Jon Atack) Pull request description: Follow-up to #11413 providing a base to build on for #19543: - bugfix for `bumpfee` raising a JSON error with explicit feerates, fixes issue #20219 - adds explicit feerate test coverage for `bumpfee`, `fundrawtransaction`, `walletcreatefundedpsbt`, `send`, `sendtoaddress`, and `sendmany` - improves a few related RPC error messages and `ParseConfirmTarget()` / error message - fixes/improves the explicit fee rate information in the 6 RPC helps, of which 2 were also missing `conf_target` sat/B units This provides a spec and regression coverage for the potential next step of a universal `sat/vB` feerate argument (see #19543), as well as immediate coverage and minimum fixes for 0.21. ACKs for top commit: kallewoof: Concept/Tested ACK 0be29000c011dec0722481dbebb159873da6fa54 meshcollider: Code review + functional test run ACK 0be29000c011dec0722481dbebb159873da6fa54 Tree-SHA512: efd965003e991cba51d4504e2940f06ab3d742e34022e96a673606b44fad85596aa03a8c1809f06df7ebcf21a38e18a891e54392fe3d6fb4d120bbe4ea0cf5e0
2020-11-01Use importdescriptors for descriptor wallets in wallet_bumpfee.pyAndrew Chow
If using descriptor wallets, use importdescriptors instead of importmulti.
2020-10-27wallet: combine redundant bumpfee invalid params and args testsJon Atack
might be best reviewed with: git show COMMIT_HASH -w --color-moved=dimmed-zebra
2020-10-27wallet: improve bumpfee error/help, add explicit fee rate coverageJon Atack
2020-10-24wallet, bugfix: fix bumpfee with explicit fee rate modesJon Atack
2020-10-05scripted-diff: update max-fee-exceeded error message to include RPCgzhao408
-BEGIN VERIFY SCRIPT- sed -i 's/Fee exceeds maximum configured by \-\maxtxfee/Fee exceeds maximum configured by user (e.g. -maxtxfee, maxfeerate)/g' src/util/error.cpp test/functional/rpc_fundrawtransaction.py test/functional/rpc_psbt.py test/functional/rpc_rawtransaction.py test/functional/wallet_bumpfee.py test/functional/wallet_create_tx.py -END VERIFY SCRIPT-
2020-08-24test: Fix intermittent issue in wallet_bumpfeeMarcoFalke
2020-08-24test: Select at least the fee in wallet_bumpfee to avoid negative amountsMarcoFalke
2020-08-13Merge #18654: rpc: separate bumpfee's psbt creation function into psbtbumpfeeSamuel Dobson
79d6332e9e4fc01e6418247c31e31b4faa1b3b84 moveonly: Fix indentation in bumpfee RPC (Andrew Chow) 431071c28ae35be8aa012df51233be19067d625c Hide bumpfee's psbt creation behavior behind -deprecatedrpc (Andrew Chow) 4638224f64ba7c8ea7c4fb550ec89c6a6d8c7887 Add psbtbumpfee RPC (Andrew Chow) Pull request description: Adds a new RPC `psbtbumpfee` which always creates a psbt. `bumpfee` will then only be able to create and broadcast fee bumping transactions instead of changing its behavior based on `IsWalletSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS)`. Split from #18627 ACKs for top commit: Sjors: re-utACK 79d6332 meshcollider: utACK 79d6332e9e4fc01e6418247c31e31b4faa1b3b84 fjahr: Code review ACK 79d6332e9e4fc01e6418247c31e31b4faa1b3b84 Tree-SHA512: 1c92c4b4461bb30e78be3ee73165f624398ef33996ce36043b61a8931be667030d0fca12fd0b30097b78c56e4e9092c69582b237cbdac51d56f6be23d8c0f1bb
2020-08-06refactor: test: use _ variable for unused loop countersSebastian Falbesoner
substitutes "for x in range(N):" by "for _ in range(N):" indicates to the reader that a block is just repeated N times, and that the loop counter is not used in the body
2020-06-25Add psbtbumpfee RPCAndrew Chow
2020-06-24tests for bumpfee / estimate_modesKarl-Johan Alm
* invalid parameter tests for bumpfee * add tests for no conf_target explicit estimate_modes
2020-05-01wallet: Remove trailing whitespace from potential translation stringsMarcoFalke
If the potential translation strings are translated in the future, trailing whitespace is going to make translation effort harder.
2020-04-28test: Fix wallet_bumpfee intermittent errorMarcoFalke
2020-04-17Merge #18673: scripted-diff: Sort test includesMarcoFalke
fa4632c41714dfaa699bacc6a947d72668a4deef test: Move boost/stdlib includes last (MarcoFalke) fa488f131fd4f5bab0d01376c5a5013306f1abcd scripted-diff: Bump copyright headers (MarcoFalke) fac5c373006a9e4bcbb56843bb85f1aca4d87599 scripted-diff: Sort test includes (MarcoFalke) Pull request description: When writing tests, often includes need to be added or removed. Currently the list of includes is not sorted, so developers that write tests and have `clang-format` installed will either have an unrelated change (sorting) included in their commit or they will have to manually undo the sort. This pull preempts both issues by just sorting all includes in one commit. Please be aware that this is **NOT** a change to policy to enforce clang-format or any other developer guideline or process. Developers are free to use whatever tool they want, see also #18651. Edit: Also includes a commit to bump the copyright headers, so that the touched files don't need to be touched again for that. ACKs for top commit: practicalswift: ACK fa4632c41714dfaa699bacc6a947d72668a4deef jonatack: ACK fa4632c41714dfaa, light review and sanity checks with gcc build and clang fuzz build Tree-SHA512: 130a8d073a379ba556b1e64104d37c46b671425c0aef0ed725fd60156a95e8dc83fb6f0b5330b2f8152cf5daaf3983b4aca5e75812598f2626c39fd12b88b180
2020-04-17Merge #18467: rpc: Improve documentation and return value of settxfeeMarcoFalke
38677274f931088218eeb1f258077d3387f39c89 rpc: settxfee respects -maxtxfee wallet setting (Fabian Jahr) bda84a08a0ac92dff6cadc99cf9bb8c3fadd7e13 rpc: Add documentation for deactivating settxfee (Fabian Jahr) Pull request description: ~~Closes 18315~~ `settxfee` can be deactivated by passing 0 as the fee. That does not seem to be documented for the user so this PR adds it in the description. The return value of a simple boolean seems also too simplified given the multiple dimensions that this deactivation feature enables. I.e. it does not seem intuitive if the returned boolean shows that the call succeeded or if means that `settxfee` is active. My suggested solution is to change the return value to a JSON object that included the "active" state and the currently set fee rate. Examples: ``` $ src/bitcoin-cli settxfee 0.0000000 { "active": false, "fee_rate": "0.00000000 BTC/kB" } $ src/bitcoin-cli settxfee 0.0001 { "active": true, "fee_rate": "0.00010000 BTC/kB" } ``` ACKs for top commit: MarcoFalke: ACK 38677274f931088218eeb1f258077d3387f39c89, seems useful to error out early instead of later #16257 🕍 jonatack: ACK 38677274f931088218eeb meshcollider: LGTM, utACK 38677274f931088218eeb1f258077d3387f39c89 Tree-SHA512: 642813b5cf6612abb4b6cb63728081a6bd1659d809e0149c8f56060b6da7253fee989b3b202854f3051df3773c966799af30b612648c466b099f00590f356548
2020-04-16scripted-diff: Bump copyright headersMarcoFalke
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT-
2020-04-14rpc: settxfee respects -maxtxfee wallet settingFabian Jahr
2020-04-06test: wallet_bumpfee assertion fixupJon Atack
2020-04-06test: relax bumpfee dust_to_fee txsize an extra vbyteJon Atack
and add explanatory documentation for the reasoning.
2020-03-26rpc: remove deprecated totalFee arg from RPC bumpfeeJon Atack