Skip to content

Commit

Permalink
Merge bitcoin#23608: test: fix feature_rbf.py --descriptors and add…
Browse files Browse the repository at this point in the history
… to test runner

b79dbe8 test: add feature_rbf.py --descriptors to test_runner.py (Sebastian Falbesoner)
166f8ec test: always rescan after importing private keys in `init_wallet` helper (Sebastian Falbesoner)

Pull request description:

  The functional test feature_rbf.py currently fails on master branch, if descriptor wallets are used (argument `--descriptors`). This is due to the fact that in this case, a call to the helper `init_wallet`

  https://github.com/bitcoin/bitcoin/blob/111c3e06b35b7867f2e0f740e988f648ac6c325d/test/functional/test_framework/test_framework.py#L428-L434

  creates a wallet without rescanning the blockchain; the test framework maps the importprivkey RPC calls to the importdescriptors RPC without rescanning by default (timestamp='now'). Fix this by always calling with `rescan=True`, which calls importdescriptors with timestamp=0. Also add `feature_rbf.py --descriptors` to the list of the test runner's calls.

  Fixes bitcoin#23563.

ACKs for top commit:
  mjdietzx:
    ACK b79dbe8

Tree-SHA512: a3f3f7a4077066e3c910919d3b5e04bc6b580c1e0a06e9a2fc258950eaea5e59c0f805c8f00432aea722609f2f7e41eebfab653471b76729c5a316825a3d8c86
  • Loading branch information
fanquake authored and jagdeep sidhu committed Nov 29, 2021
1 parent 3816330 commit 998dcb1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/functional/test_framework/test_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ def init_wallet(self, *, node):
n = self.nodes[node]
if wallet_name is not None:
n.createwallet(wallet_name=wallet_name, descriptors=self.options.descriptors, load_on_startup=True)
n.importprivkey(privkey=n.get_deterministic_priv_key().key, label='coinbase')
n.importprivkey(privkey=n.get_deterministic_priv_key().key, label='coinbase', rescan=True)

def run_test(self):
"""Tests must override this method to define test logic"""
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 @@ -229,7 +229,8 @@
'rpc_getblockfilter.py',
'rpc_invalidateblock.py',
'feature_utxo_set_hash.py',
'feature_rbf.py',
'feature_rbf.py --legacy-wallet',
'feature_rbf.py --descriptors',
'mempool_packages.py',
'mempool_package_onemore.py',
'rpc_createmultisig.py --legacy-wallet',
Expand Down

0 comments on commit 998dcb1

Please sign in to comment.