bitcoin/test/functional/test_framework
MarcoFalke 2182149dc5
Merge bitcoin/bitcoin#26631: test: add coverage for dust mempool policy (-dustrelayfee setting)
d6fc1d6a33 test: add coverage for dust mempool policy (`-dustrelayfee` setting) (Sebastian Falbesoner)
8a5dbe2879 test: add `CScript` method for checking for witness program (Sebastian Falbesoner)

Pull request description:

  This PR adds missing test coverage for the `-dustrelayfee` setting, which specifies the fee-rate used to define dust. Output scripts for all common types that are treated as standard by default (P2PK, P2(W)PKH, P2(W)SH, P2TR, bare multisig, null data, unknown witness versions v2+) are created and then checked for dust-mempool-policy each via the `testmempoolaccept` RPC: a tx with an output's nValue equal to the dust threshold should be accepted, one with an nValue of just one 1 satoshi below that should be rejected with reason `dust`. This is repeatedly done for a fixed (but obviously somewhat arbitrary) list of different `-dustrelayfee` settings on a single node, including the default and zero (i.e. no dust limit) settings.

  Note that the first commit introduces a necessary `CScript` helper method `IsWitnessProgram` (using PascalCase in Python is likely controversial; in this case the style for the already existing method `GetSigOpCount` was followed, which also refers to a method in the core `CScript` class).

  Some historical information about dust, contributed by pablomartin4btc:
  "The concept of dust was first introduced in https://github.com/bitcoin/bitcoin/pull/2577. This [commit](eb30d1a5b2) from https://github.com/bitcoin/bitcoin/pull/9380 introduced the -dustrelayfee option. Previous to that PR, the dust feerate was whatever -minrelaytxfee was set to."

ACKs for top commit:
  LarryRuane:
    ACK d6fc1d6a33
  glozow:
    ACK d6fc1d6a33
  kouloumos:
    ACK d6fc1d6a33

Tree-SHA512: 35ea2b2497dfb466395af5665bb217f7250aa7cab9dc43539a5658ab69a454e3623ff58fce7489fcc1105b37f8cb4840a93cec658c5df1de611732bc6439ccad
2023-01-16 11:36:13 +01:00
..
__init__.py Rename rpc-tests directory to functional 2017-03-20 10:40:31 -04:00
address.py scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
authproxy.py rpc: Allow named and positional arguments to be used together 2022-11-05 05:32:39 -04:00
bdb.py scripted-diff: Bump copyright headers 2021-11-10 11:10:24 +01:00
bip340_test_vectors.csv tests: add BIP340 Schnorr signature support to test framework 2020-10-12 17:18:47 -07:00
blockfilter.py test: add compact block filter (BIP158) helper routines 2022-10-20 01:33:17 +02:00
blocktools.py scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
coverage.py scripted-diff: Bump copyright headers 2021-11-10 11:10:24 +01:00
descriptors.py Output a descriptor in createmultisig and addmultisigaddress 2020-01-30 23:55:36 -05:00
key.py script, test: fix python linter E275 errors with flake8 5.0.4 2023-01-03 10:59:56 -08:00
messages.py scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
muhash.py test: Change MuHash Python implementation to match cpp version again 2020-12-22 01:48:34 +01:00
netutil.py scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
p2p.py scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
psbt.py tests: Test that PSBT_OUT_TAP_TREE is combined correctly 2022-10-06 15:32:45 -04:00
ripemd160.py Add pure Python RIPEMD-160 2021-12-08 14:29:34 -05:00
script.py Merge bitcoin/bitcoin#26631: test: add coverage for dust mempool policy (-dustrelayfee setting) 2023-01-16 11:36:13 +01:00
script_util.py scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
segwit_addr.py Use Bech32m encoding for v1+ segwit addresses 2021-03-16 10:48:36 -07:00
siphash.py script, test: fix python linter E275 errors with flake8 5.0.4 2023-01-03 10:59:56 -08:00
socks5.py scripted-diff: Update copyright in ./test 2019-03-02 10:58:35 -05:00
test_framework.py test: skip sqlite3 tests if it isn't available 2023-01-12 13:37:15 +00:00
test_node.py scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
test_shell.py scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
util.py scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
wallet.py scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
wallet_util.py scripted-diff: Bump copyright headers 2021-11-10 11:10:24 +01:00