test: remove wallet dependency and refactor rpc_signrawtransaction.py #25512

pull ayush933 wants to merge 1 commits into bitcoin:master from ayush933:rpc_signrawtransactionwithkey_no_wallet changing 3 files +146 −99
  1. ayush933 commented at 2:05 PM on June 30, 2022: contributor

    rpc_signrawtransaction.py currently tests the signrawtransactionwithkey and signrawtransactionwithwallet RPCs.

    This PR splits rpc_signrawtransaction.py into

    1. rpc_signrawtransactionwithkey.py: the tests for signrawtransactionwithkey are moved here and this test can now be run with the wallet disabled.
    2. wallet_signrawtransactionwithwallet.py: wallet only tests for signrawtransactionwithwallet.py
  2. test: refactor rpc_signrawtransaction.py
    rpc_signrawtransaction.py is split into rpc_signrawtransactionwithkey.py and wallet_signrawtransactionwithwallet.py.
    rpc_signrawtransactionwithkey.py can be run with the wallet disabled.
    0ee43d13e9
  3. fanquake added the label Tests on Jun 30, 2022
  4. DrahtBot commented at 7:55 PM on June 30, 2022: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #20892 (tests: Run both descriptor and legacy tests within a single test invocation by achow101)

    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.

  5. ayush933 renamed this:
    test: refactor rpc_signrawtransaction.py
    test:remove wallet dependency and refactor rpc_signrawtransaction.py
    on Jul 1, 2022
  6. ayush933 renamed this:
    test:remove wallet dependency and refactor rpc_signrawtransaction.py
    test: remove wallet dependency and refactor rpc_signrawtransaction.py
    on Jul 1, 2022
  7. aureleoules commented at 12:05 PM on July 6, 2022: member

    tACK 0ee43d13e993a59fe1ba509f617dd0e01e1068e2. I verified that the tests were not altered during the refactor.

    My understanding is that self.nodes[0].sendtoaddress was replaced with the function send_to_address to remove the wallet dependency.

  8. MarcoFalke merged this on Jul 11, 2022
  9. MarcoFalke closed this on Jul 11, 2022

  10. in test/functional/rpc_signrawtransactionwithkey.py:48 in 0ee43d13e9
      43 | +        input = {"txid": self.nodes[0].getblock(self.block_hash[self.blk_idx])["tx"][0], "vout": 0}
      44 | +        output = {addr: amount}
      45 | +        self.blk_idx += 1
      46 | +        rawtx = self.nodes[0].createrawtransaction([input], output)
      47 | +        txid = self.nodes[0].sendrawtransaction(self.nodes[0].signrawtransactionwithkey(rawtx, [self.nodes[0].get_deterministic_priv_key().key])["hex"], 0)
      48 | +        return txid
    


    MarcoFalke commented at 1:42 PM on July 11, 2022:

    nit: As an idea for the future, this method could be removed and replaced by MiniWallet.send_to to simplify the test logic a bit. Or alternatively, the def make_utxo(self, node, amount, *, confirmed=True, scriptPubKey=None): method from feature_rbf could be moved to the test_framework and reused here?

  11. sidhujag referenced this in commit a2af5feeb9 on Jul 11, 2022
  12. bitcoin locked this on Jul 11, 2023

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: 2026-04-29 03:14 UTC

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