Skip to content

Conversation

@ayush933
Copy link
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

rpc_signrawtransaction.py is split into rpc_signrawtransactionwithkey.py and wallet_signrawtransactionwithwallet.py.
rpc_signrawtransactionwithkey.py can be run with the wallet disabled.
@fanquake fanquake added the Tests label Jun 30, 2022
@DrahtBot
Copy link
Contributor

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

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.

@ayush933 ayush933 changed the title test: refactor rpc_signrawtransaction.py test:remove wallet dependency and refactor rpc_signrawtransaction.py Jul 1, 2022
@ayush933 ayush933 changed the title test:remove wallet dependency and refactor rpc_signrawtransaction.py test: remove wallet dependency and refactor rpc_signrawtransaction.py Jul 1, 2022
Copy link
Contributor

@aureleoules aureleoules left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK 0ee43d1.
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.

@maflcko maflcko merged commit 0817cc3 into bitcoin:master Jul 11, 2022
Comment on lines +42 to +48
def send_to_address(self, addr, amount):
input = {"txid": self.nodes[0].getblock(self.block_hash[self.blk_idx])["tx"][0], "vout": 0}
output = {addr: amount}
self.blk_idx += 1
rawtx = self.nodes[0].createrawtransaction([input], output)
txid = self.nodes[0].sendrawtransaction(self.nodes[0].signrawtransactionwithkey(rawtx, [self.nodes[0].get_deterministic_priv_key().key])["hex"], 0)
return txid
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jul 11, 2022
@bitcoin bitcoin locked and limited conversation to collaborators Jul 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants