mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-02 19:52:01 +02:00
Give more errors for specific failure conditions
Some failure conditions implicitly fail by failing some other check. But the error messages are more helpful if they say explicitly what actually caused the failure, so add those as failure conditions and errors.
This commit is contained in:
@ -13,14 +13,14 @@ class DeriveaddressesTest(BitcoinTestFramework):
|
||||
self.supports_cli = 1
|
||||
|
||||
def run_test(self):
|
||||
assert_raises_rpc_error(-5, "Invalid descriptor", self.nodes[0].deriveaddresses, "a")
|
||||
assert_raises_rpc_error(-5, "Missing checksum", self.nodes[0].deriveaddresses, "a")
|
||||
|
||||
descriptor = "wpkh(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/1/1/0)#t6wfjs64"
|
||||
address = "bcrt1qjqmxmkpmxt80xz4y3746zgt0q3u3ferr34acd5"
|
||||
assert_equal(self.nodes[0].deriveaddresses(descriptor), [address])
|
||||
|
||||
descriptor = descriptor[:-9]
|
||||
assert_raises_rpc_error(-5, "Invalid descriptor", self.nodes[0].deriveaddresses, descriptor)
|
||||
assert_raises_rpc_error(-5, "Missing checksum", self.nodes[0].deriveaddresses, descriptor)
|
||||
|
||||
descriptor_pubkey = "wpkh(tpubD6NzVbkrYhZ4WaWSyoBvQwbpLkojyoTZPRsgXELWz3Popb3qkjcJyJUGLnL4qHHoQvao8ESaAstxYSnhyswJ76uZPStJRJCTKvosUCJZL5B/1/1/0)#s9ga3alw"
|
||||
address = "bcrt1qjqmxmkpmxt80xz4y3746zgt0q3u3ferr34acd5"
|
||||
|
Reference in New Issue
Block a user