This PR adds test coverage for the following errors for the signrawtransactionwithkey RPC:
- Invalid private key
- TX decode failed
For reference: https://maflcko.github.io/b-c-cov/total.coverage/src/rpc/rawtransaction.cpp.gcov.html
This PR adds test coverage for the following errors for the signrawtransactionwithkey RPC:
For reference: https://maflcko.github.io/b-c-cov/total.coverage/src/rpc/rawtransaction.cpp.gcov.html
* Invalid private key
* TX decode failed
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--006a51241073e994b41acfe9ec718e94-->
For detailed information about the code coverage, see the test coverage report.
<!--021abf342d371248e50ceaed478a90ca-->
See the guideline for information on the review process.
| Type | Reviewers |
|---|---|
| ACK | tdb3, maflcko, BrandonOdiwuor, kevkevinpal |
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
125 | @@ -126,10 +126,20 @@ def invalid_sighashtype_test(self): 126 | privkeys = [self.nodes[0].get_deterministic_priv_key().key] 127 | assert_raises_rpc_error(-8, "'all' is not a valid sighash parameter.", self.nodes[0].signrawtransactionwithkey, tx, privkeys, sighashtype="all") 128 | 129 | + def invalid_private_key_and_tx(self):
nit: An invalid private key and an invalid transaction could be tested separately rather than in the same function. Was there a rationale for combining them?
To avoid calling same stuff twice. e.g. createrawtransaction.
ACK e2779ce98b39e14cada08a654928e798436f5a46
Ran rpc_signrawtransactionwithkey locally (passed). Intentionally caused test failure by 1) using privkey cUeKHd5orzT3mz8P9pxyREHfsWtVfgsfDjiZZBcjUBAaGk1BTj7N and independently by 2) removing the trailing 00 from the tx. Test failed as expected each time.
ACK e2779ce98b39e14cada08a654928e798436f5a46
Code Review ACK e2779ce98b39e14cada08a654928e798436f5a46
ACK e2779ce