Skip to content

Commit

Permalink
Merge bitcoin#23725: test: fix `feature_coinstatsindex.py --descripto…
Browse files Browse the repository at this point in the history
…rs` and add to test runner

61fb410 test: add feature_coinstatsindex.py --descriptors to test_runner.py (Sebastian Falbesoner)
50b044a test: fix test feature_coinstatsindex.py for descriptor wallets (Sebastian Falbesoner)

Pull request description:

  The functional test feature_coinstatsindex.py currently fails on master branch, if descriptor wallets are used (argument `--descriptors`; or if BDB is not compiled, see bitcoin#23682 (comment)). This is due to the fact that different change output types are used for created transactions (P2WPKH for legacy wallets, P2TR for descriptor wallets; the former doesn't have a ScriptPubKeyMan for bech32m), resulting in different tx sizes and hence also fees. Fix this by explicitely setting the output type via passing both `-addresstype=bech32` and `-changetype=bech32` as argument. The former would not be needed by now, but makes the test more deterministic and avoids a failure if bech32m becomes the default address type.

  Should further pave the way for bitcoin#23682.

ACKs for top commit:
  MarcoFalke:
    cr ACK 61fb410

Tree-SHA512: 300a53f539c0b874da5fc1dd1e4e41b9408dc5526c5858c79f0aabf2ab07e57df4c9cc627fafe25246206752754a91a2977a3df8f8b2d98fb98e51c7e4d81633
  • Loading branch information
MarcoFalke authored and vijaydasmp committed Sep 10, 2024
1 parent 0120fce commit 2ea83c5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion test/functional/feature_coinstatsindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ def set_test_params(self):
self.num_nodes = 2
self.supports_cli = False
self.extra_args = [
[],
# Explicitly set the output type in order to have consistent tx vsize / fees
# for both legacy and descriptor wallets (disables the change address type detection algorithm)
["-addresstype=bech32", "-changetype=bech32"],
["-coinstatsindex"]
]

Expand Down
2 changes: 1 addition & 1 deletion test/functional/interface_bitcoin_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def run_test(self):

if self.is_wallet_compiled():
self.log.info("Test -getinfo and dash-cli getwalletinfo return expected wallet info")
# Explicitely set the output type in order to have constintent tx vsize / fees
# Explicitly set the output type in order to have consistent tx vsize / fees
self.restart_node(0, extra_args=["-addresstype=bech32", "-changetype=bech32"])
assert_equal(Decimal(cli_get_info['Balance']), BALANCE)
assert 'Balances' not in cli_get_info_string
Expand Down
3 changes: 2 additions & 1 deletion test/functional/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,8 @@
'rpc_scantxoutset.py',
'feature_logging.py',
'feature_anchors.py',
'feature_coinstatsindex.py',
'feature_coinstatsindex.py --legacy-wallet',
'feature_coinstatsindex.py --descriptors',
'wallet_orphanedreward.py',
'p2p_node_network_limited.py',
'p2p_permissions.py',
Expand Down

0 comments on commit 2ea83c5

Please sign in to comment.