test: use MiniWallet for p2p_filter.py #23079

pull theStack wants to merge 3 commits into bitcoin:master from theStack:202109-test-use_MiniWallet_for_p2p_filter changing 3 files +50 −30
  1. theStack commented at 1:24 am on September 24, 2021: member
    This PR enables one more of the non-wallet functional tests (p2p_filter.py) to be run even with the Bitcoin Core wallet disabled by using the MiniWallet instead, as proposed in #20078. For this purpose, a MiniWallet method send_to is introduced first, which allows to create arbitrary outputs (scriptPubKey/amount). Note that the implementation for this is already present in feature_rbf.py (recently added in PR #22998), i.e. it is simply moved to the MiniWallet interface.
  2. fanquake added the label Tests on Sep 24, 2021
  3. in test/functional/p2p_filter.py:40 in 3fe3d37303 outdated
    35+
    36+
    37+def random_p2wpkh():
    38+    key = ECKey()
    39+    key.generate()
    40+    return key_to_p2wpkh_script(key.get_pubkey().get_bytes())
    


    Shubhankar-Gambhir commented at 5:52 am on September 24, 2021:
    wouldn’t it be better to add this function in miniwallet? then if required it can be used in other tests as well.

    theStack commented at 3:31 pm on September 24, 2021:
    Good idea, done. Note though that I didn’t put it directly into the MiniWallet class (since it doesn’t need any of its internal state), but as global function into the test_framework/wallet.py module.
  4. theStack force-pushed on Sep 24, 2021
  5. test: MiniWallet: add `send_to` method to create arbitrary txouts
    With this new method, outputs to an arbitrary scriptPubKey/amount can
    be created. Note that the implementation was already present in the
    test feature_rbf.py and is just moved to the MiniWallet interface, in
    order to enable other tests to also use it.
    aa26797f69
  6. test: introduce helper to create random P2WPKH scriptPubKeys 6fc2cd3f09
  7. test: use MiniWallet for p2p_filter.py
    This test can now be run even with the Bitcoin Core wallet disabled.
    cfdb6baa22
  8. theStack force-pushed on Sep 27, 2021
  9. theStack commented at 11:57 am on September 27, 2021: member
    Rebased on master to (hopefully) get rid of the Windows CI failure.
  10. laanwj commented at 3:19 pm on September 28, 2021: member
    Code review ACK cfdb6baa22b8eb526fcbe1e5131bf4a3fd0cd672
  11. DrahtBot commented at 7:25 pm on September 28, 2021: member

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #23118 (test: refactor: introduce script_util helper for creating P2PK scripts by theStack)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  12. MarcoFalke merged this on Sep 29, 2021
  13. MarcoFalke closed this on Sep 29, 2021

  14. sidhujag referenced this in commit c333dd03dc on Sep 29, 2021
  15. DrahtBot locked this on Oct 30, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-26 06:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me