No description provided.
tests: Added missing tests for RPC wallet errors #15378
pull benthecarman wants to merge 1 commits into bitcoin:master from benthecarman:tests_missing_tests changing 1 files +26 −0-
benthecarman commented at 1:08 AM on February 10, 2019: contributor
- fanquake added the label Tests on Feb 10, 2019
-
in test/functional/wallet_basic.py:359 in e6588051b6 outdated
354 | + assert_raises_rpc_error(-5, "Invalid Bitcoin address or script", self.nodes[0].importaddress, "invalid") 355 | + 356 | + # This will raise an execption for attempting to import a pubkey that isn't in hex 357 | + assert_raises_rpc_error(-5, "Pubkey must be a hex string", self.nodes[0].importpubkey, "not hex") 358 | + 359 | + # This will raise an execption for importing an invalid pubkey
fanquake commented at 1:11 AM on February 10, 2019:Please fix the indentation here. https://travis-ci.org/bitcoin/bitcoin/jobs/491122519
benthecarman force-pushed on Feb 10, 2019DrahtBot commented at 3:08 AM on February 10, 2019: member<!--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:
- #11413 ([wallet] [rpc] sendtoaddress/sendmany: Add explicit feerate option by kallewoof)
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.
practicalswift commented at 11:44 AM on February 10, 2019: contributorConcept ACK
in test/functional/wallet_basic.py:347 in 4d931047d5 outdated
342 | + assert_raises_rpc_error(-5, "Cannot use the p2sh flag with an address - use a script instead", self.nodes[0].importaddress, temp_address, "label", False, True) 343 | + 344 | + # This will raise an exception for attempting to dump the private key of an address you do not own 345 | + assert_raises_rpc_error(-3, "Address does not refer to a key", self.nodes[0].dumpprivkey, temp_address) 346 | + 347 | + # This will raise an execption for attempting to get the private key of an invalid Bitcoin address
practicalswift commented at 8:29 PM on February 11, 2019:Execption is an exceptional spelling of exception :-)
Applies also to the four execptional cases below.
benthecarman commented at 8:35 PM on February 11, 2019:Fixed
benthecarman force-pushed on Feb 11, 2019tests: Added missing tests for RPC wallet errors dc3b2ccb5fbenthecarman force-pushed on Feb 12, 2019promag commented at 5:35 PM on February 12, 2019: memberutACK dc3b2cc.
in test/functional/wallet_basic.py:342 in dc3b2ccb5f
337 | + # This will raise an exception for the invalid private key format 338 | + assert_raises_rpc_error(-5, "Invalid private key encoding", self.nodes[0].importprivkey, "invalid") 339 | + 340 | + # This will raise an exception for importing an address with the PS2H flag 341 | + temp_address = self.nodes[1].getnewaddress() 342 | + assert_raises_rpc_error(-5, "Cannot use the p2sh flag with an address - use a script instead", self.nodes[0].importaddress, temp_address, "label", False, True)
MarcoFalke commented at 8:27 PM on February 12, 2019:nit in the future use named arguments
MarcoFalke commented at 8:29 PM on February 12, 2019: memberAlso reminds me that we shouldn't extend wallet_basic, but rather extend the more specific wallet tests
MarcoFalke merged this on Feb 12, 2019MarcoFalke closed this on Feb 12, 2019MarcoFalke referenced this in commit ea022d9fd0 on Feb 12, 2019benthecarman deleted the branch on Feb 26, 2019deadalnix referenced this in commit 1884ca2a13 on Oct 1, 2020PastaPastaPasta referenced this in commit e8036caa14 on Jun 27, 2021PastaPastaPasta referenced this in commit 1576b2bc2c on Jun 28, 2021PastaPastaPasta referenced this in commit f93085f1d4 on Jun 28, 2021PastaPastaPasta referenced this in commit ca9247fac4 on Jun 29, 2021DrahtBot locked this on Dec 16, 2021Labels
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-24 15:15 UTC
More mirrored repositories can be found on mirror.b10c.me