aboutsummaryrefslogtreecommitdiff
path: root/test/functional/wallet_bumpfee.py
AgeCommit message (Collapse)Author
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
2020-03-22test: update bumpfee testing from totalFee to fee_rateJon Atack
2020-03-10bumpfee test: exit loop at proper time with new fee value being comparedGregory Sanders
2020-03-10Add some test logging to wallet_bumpfee.pyGregory Sanders
2019-12-18Test watchonly wallet bumpfee with PSBT returnGregory Sanders
Co-authored-by: Sjors Provoost <sjors@sprovoost.nl>
2019-12-01Fix origfee return for bumpfee with feerate argGregory Sanders
2019-11-15Merge #17322: Fix input size assertion in wallet_bumpfee.pyMarcoFalke
38516f9078497d3e8456d48300eca40c35a281f2 Fix input size assertion in wallet_bumpfee.py (Gregory Sanders) Pull request description: I was investigating a curious error for https://github.com/bitcoin/bitcoin/pull/17290 and realized that this check should have caught that error earlier in the test. The loop is intended to ensure that only a single input exists the entire time until the change output disappears, a single additional bump occurs, then it leaves the loop. Top commit has no ACKs. Tree-SHA512: 1d2d6ef535ec2c55f516ee5de11352386ceac6bedaabc6842229a486d9f28d35310ad5f57bfcc1f1e654fc397ecff29ec33256f9b3da897500b7e1635004b63a
2019-11-15Fix input size assertion in wallet_bumpfee.pyGregory Sanders
2019-10-22test: use default address type (bech32) for wallet_bumpfee testsSebastian Falbesoner
The use of native segwit addresses (pure p2wpkh instead of p2sh-p2wpkh) leads to smaller transaction sizes, needing adaption of some constants in the following test cases: - test_dust_to_fee(): adaption of dust calculation (p2wpkh spend estimate of 67 is taken from src/policy/policy.cpp:GetDustThreshold()) - test_maxtxfee_fails(): lowering -maxtxfee setting to trigger fail
2019-10-02Merge #16884: wallet: Change default address type to bech32Wladimir J. van der Laan
71d4eddf42eb5a15e434d2273f11d0a3942ef502 Add release note for bech32 by default in wallet (Gregory Sanders) b34f0180e39fc95d88596a987724b994707e2552 Revert "gui: Generate bech32 addresses by default (take 2, fixup)" (Gregory Sanders) f50785ab56c0c094960c7049cfe9209b101e2823 Change default address type to bech32 (Gregory Sanders) Pull request description: ACKs for top commit: MarcoFalke: re-ACK 71d4eddf42eb5a15e434d2273f11d0a3942ef502 (only change is restore mimick behavior) laanwj: ACK 71d4eddf42eb5a15e434d2273f11d0a3942ef502 Tree-SHA512: 3c49a1b51c49f3a762ad08985167ca1b89b0177ae20ab6d5883f1f74dde7a155921c1b855a842199bbf32f563c56b33f8b603bc842637bdcb121001023d454b6
2019-10-02Merge #16727: wallet: Explicit feerate for bumpfeeWladimir J. van der Laan
c812aba3949b6ab81030dc708cda7c8821be2f70 test bumpfee fee_rate argument (ezegom) 9f25de3d9eb8d012ca1a98cbcd28021e3e1c85ee rpc bumpfee check fee_rate argument (ezegom) 88e5f997dfab3f03bb1ec3f149eaff8dcc2981fe rpc bumpfee: add fee_rate argument (ezegom) 1a4c791cf49ff15aa9deba4388c0180b8f47f15b rpc bumpfee: move feerate estimation logic into separate method (ezegom) Pull request description: Taking over for https://github.com/bitcoin/bitcoin/pull/16492 which seems to have gone inactive. Only minor commit cleanups, rebase, and some help text fixes on top of previous PR. Renamed `feeRate` to `fee_rate` to reflect updated guidelines. ACKs for top commit: Sjors: Code review ACK c812aba laanwj: ACK c812aba3949b6ab81030dc708cda7c8821be2f70 Tree-SHA512: 5f7f51bd780a573ccef1ccd72b0faf3e5d143f6551060a667560c5163f7d9480e17e73775d1d7bcac0463f3b6b4328f0cff7b27e39483bddc42a530f4583ce30
2019-09-30test bumpfee fee_rate argumentezegom
2019-09-26Change default address type to bech32Gregory Sanders
2019-09-17scripted-diff: test: Replace connect_nodes_bi with connect_nodesMarcoFalke
-BEGIN VERIFY SCRIPT- sed -i --regexp-extended -e 's/connect_nodes_bi\(self.nodes,\s*(.),\s*/connect_nodes(self.nodes[\1], /g' $(git grep -l connect_nodes_bi) sed -i --regexp-extended -e 's/connect_nodes_bi(,| )/connect_nodes\1/g' $(git grep -l connect_nodes_bi) -END VERIFY SCRIPT-
2019-07-26deprecate totalFee argument in bumpfee RPC callGregory Sanders
2019-07-02wallet: Fix -maxtxfee check by moving it to CWallet::CreateTransactionJoão Barbosa
2019-07-02Merge #15538: wallet_bumpfee.py: Make sure coin selection produces changeWladimir J. van der Laan
276972cb95ba944a7a4b1858a08d333962261396 wallet_bumpfee.py: Make sure coin selection produces change (Gregory Sanders) Pull request description: I was hitting the case where change-less transactions were being made. ACKs for top commit: ryanofsky: utACK 276972cb95ba944a7a4b1858a08d333962261396 Tree-SHA512: e2b7a50363daddd3ee749cacfc9d3d685a6c0c7e3e48118bb60131d205bf83ea06cdd66b69dfa3bd4dbb3bbf2b5b673d7225171486ae72fc762e5dabe2c01ef5
2019-05-08test: Remove True argument to CBlock::serializeMarcoFalke
Unnamed arguments are confusing as to what they mean without looking up the function signature. Since segwit is active by default in regtest, and all blocks are serialized with witness (#15664, c459c5f), remove the argument `with_witness=True` from all calls to `CBlock::serialize` and `BlockTransactions::serialize`. This diff has been created with a script, but is better reviewed without a scripted diff. sed -i --regexp-extended -e 's/block(_?[2a-z]*)\.serialize\([a-z_]*=?True/block\1.serialize(/g' $(git grep -l serialize ./test)
2019-04-15Merge #15557: Enhance `bumpfee` to include inputs when targeting a feerateMeshCollider
184f8785f wallet_bumpfee.py: add test for change key preservation (Gregory Sanders) d08becff8 add functional tests for feerate bumpfee with adding inputs (Gregory Sanders) 0ea47ba7b generalize bumpfee to add inputs when needed (Gregory Sanders) Pull request description: When targeting a feerate using `bumpfee`, call a new function that directly uses `CWallet::CreateTransaction` and coin control to get the desired result. This allows us to get a superset of previous behavior, with an arbitrary RBF bump of a transaction provided it passes the preconditional checks and spare confirmed utxos are available. Note(s): 0) The coin selection will use knapsack solver for the residual selection. 1) This functionality, just like knapsack coin selection in general, will hoover up negative-value inputs when given the chance. 2) Newly added inputs must be confirmed due to current Core policy. See error: `replacement-adds-unconfirmed` 3) Supporting this with `totalFee` is difficult since the "minimum total fee" option in `CreateTransaction` logic was (rightly)taken out in #10390 . ACKs for commit 184f87: jnewbery: utACK 184f8785f710d58d9ef82e611591c9cbff5ab89d Tree-SHA512: fb6542bdfb2c6010e328ec475cf9dcbff4eb2b1a1b27f78010214534908987a5635797196fa05edddffcbcf2987335872dc644a99261886d5cbb34a8f262ad3e
2019-04-11wallet_bumpfee.py: add test for change key preservationGregory Sanders
2019-04-11add functional tests for feerate bumpfee with adding inputsGregory Sanders
2019-04-09test: Remove unused importsMarcoFalke
2019-04-09scripted-diff: use self.sync_* methodsMarcoFalke
-BEGIN VERIFY SCRIPT- sed -i -e 's/sync_blocks(self.nodes)/self.sync_blocks()/g' $(git grep -l 'sync_blocks(self.nodes)' ./test/functional/*.py) sed -i -e 's/sync_mempools(self.nodes)/self.sync_mempools()/g' $(git grep -l 'sync_mempools(self.nodes)' ./test/functional/*.py) sed -i -e 's/ sync_blocks(/ self.sync_blocks(/g' $(git grep -l sync_blocks ./test/functional/*.py) sed -i -e 's/ sync_mempools(/ self.sync_mempools(/g' $(git grep -l sync_mempools ./test/functional/*.py) -END VERIFY SCRIPT-
2019-04-09test: Pass self to test_simple_bumpfee_succeedsMarcoFalke
Needed for a future scripted diff
2019-03-05wallet_bumpfee.py: Make sure coin selection produces changeGregory Sanders
2019-03-02scripted-diff: Update copyright in ./testMarcoFalke
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./test/ -END VERIFY SCRIPT-
2019-03-02scripted-diff: test: Use py3.5 bytes::hex() methodMarcoFalke
-BEGIN VERIFY SCRIPT- sed -i -e "s/def bytes_to_hex_str/def b_2_x/g" $(git grep -l bytes_to_hex_str) export RE_B_0="[^()]*" # match no bracket export RE_B_1="${RE_B_0}\(${RE_B_0}\)${RE_B_0}" # match exactly one () export RE_B_2="${RE_B_0}\(${RE_B_1}\)${RE_B_0}" # match wrapped (()) export RE_M="(b2x|bytes_to_hex_str)\(((${RE_B_0}|${RE_B_1}|${RE_B_2})*)\)" sed -i --regexp-extended -e "s/${RE_M}/\2.hex()/g" $(git grep -l -E '(b2x|bytes_to_hex_str)') sed -i --regexp-extended -e "/ +bytes_to_hex_str( as b2x)?,/d" $(git grep -l bytes_to_hex_str) sed -i --regexp-extended -e "s/ +bytes_to_hex_str( as b2x)?,//g" $(git grep -l bytes_to_hex_str) sed -i --regexp-extended -e "s/, bytes_to_hex_str( as b2x)?//g" $(git grep -l bytes_to_hex_str) export RE_M="(binascii\.)?hexlify\(((${RE_B_0}|${RE_B_1}|${RE_B_2})*)\).decode\(${RE_B_0}\)" sed -i --regexp-extended -e "s/${RE_M}/\2.hex()/g" $(git grep -l hexlify -- ':(exclude)share') sed -i --regexp-extended -e "/from binascii import hexlify$/d" $(git grep -l hexlify -- ':(exclude)share') sed -i --regexp-extended -e "s/(from binascii import) .*hexlify/\1 unhexlify/g" $(git grep -l hexlify -- ':(exclude)share') sed -i -e 's/ignore-names "/ignore-names "b_2_x,/g' ./test/lint/lint-python-dead-code.sh -END VERIFY SCRIPT-
2018-09-23[test] Remove deprecated addwitnessaddress from wallet_bumpfee.pyJohn Newbery
2018-09-23[test] Fix flake8 warnings in testsJohn Newbery
Fix all flake8 warnings in tests that are about to be updated to remove addwitnessaddress
2018-09-14Merge #12493: [wallet] Reopen CDBEnv after encryption instead of shutting downWladimir J. van der Laan
c1dde3a949b36ce9c2155777b3fa1372e7ed97d8 No longer shutdown after encrypting the wallet (Andrew Chow) d7637c5a3f1d62922594cdfb6272e30dacf60ce9 After encrypting the wallet, reload the database environment (Andrew Chow) 5d296ac810755dc47f105eb95b52b7e2bcb8aea8 Add function to close all Db's and reload the databae environment (Andrew Chow) a769461d5e37ddcb771ae836254fdc69177a28c4 Move BerkeleyEnvironment deletion from internal method to callsite (Andrew Chow) Pull request description: This is the replacement for #11678 which implements @ryanofsky's [suggestion](https://github.com/bitcoin/bitcoin/pull/11678#pullrequestreview-76464511). Shutting down the software was to prevent the BDB environment from writing unencrypted private keys to disk in the database log files, as was noted [here](https://bitcointalk.org/index.php?topic=51474.msg616068#msg616068). This PR replaces the shutdown behavior with a CDBEnv flush, close, and reopen which achieves the same effect: everything is cleanly flushed and closed, the log files are removed, and then the environment reopened to continue normal operation. To ensure that no unencrypted private keys are in the log files after encrypting the wallet, I wrote [this script](https://gist.github.com/achow101/7f7143e6c3d3fdc034d3470e72823e9d) to pull private keys from the original wallet file and searches for these keys in the log files (note that you will have to change your file paths to make it work on your own machine). As for concerns about private keys being written to slack space or being kept in memory, these behaviors no longer exist after the original wallet encryption PR and the shutting down solution from 2011. cc @ryanofsky Tree-SHA512: 34b894283b0677a873d06dee46dff8424dec85a2973009ac9b84bcf3d22d05f227c494168c395219d9aee3178e420cf70d4b3eeacc9785aa86b6015d25758e75