Merge bitcoin/bitcoin#23926: rpc: Quote user supplied descriptor in error msg
fa4c599145rpc: Quote user supplied descriptor in error msg (MarcoFalke) Pull request description: Follow-up to commitfa24a3df87Forgotten in https://github.com/bitcoin/bitcoin/pull/23755 ACKs for top commit: hebasto: ACKfa4c599145, tested locally. prayank23: tACK https://github.com/bitcoin/bitcoin/pull/23926/commits/fa4c599145843b0d3cf998d661281a39bc438d95 Tree-SHA512: bff07bfe95644c94eeb1d27579bf9ffe33df5e709bf6e08cd24f9235f9348dc271ccc868724bcda63b94179bde55625b102cf0b783fad805d0055219743e8e5e
This commit is contained in:
2 files changed
+4
-4
No files matched your search
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2018-2021 The Bitcoin Core developers
|
// Copyright (c) 2018-2022 The Bitcoin Core developers
|
||||||
// Distributed under the MIT software license, see the accompanying
|
// Distributed under the MIT software license, see the accompanying
|
||||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
@@ -1222,7 +1222,7 @@ std::unique_ptr<DescriptorImpl> ParseScript(uint32_t& key_exp_index, Span<const
|
|||||||
error = "A function is needed within P2WSH";
|
error = "A function is needed within P2WSH";
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
error = strprintf("%s is not a valid descriptor function", std::string(expr.begin(), expr.end()));
|
error = strprintf("'%s' is not a valid descriptor function", std::string(expr.begin(), expr.end()));
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2019-2020 The Bitcoin Core developers
|
# Copyright (c) 2019-2022 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test getdescriptorinfo RPC.
|
"""Test getdescriptorinfo RPC.
|
||||||
@@ -30,7 +30,7 @@ class DescriptorTest(BitcoinTestFramework):
|
|||||||
def run_test(self):
|
def run_test(self):
|
||||||
assert_raises_rpc_error(-1, 'getdescriptorinfo', self.nodes[0].getdescriptorinfo)
|
assert_raises_rpc_error(-1, 'getdescriptorinfo', self.nodes[0].getdescriptorinfo)
|
||||||
assert_raises_rpc_error(-3, 'Expected type string', self.nodes[0].getdescriptorinfo, 1)
|
assert_raises_rpc_error(-3, 'Expected type string', self.nodes[0].getdescriptorinfo, 1)
|
||||||
assert_raises_rpc_error(-5, 'is not a valid descriptor function', self.nodes[0].getdescriptorinfo, '')
|
assert_raises_rpc_error(-5, "'' is not a valid descriptor function", self.nodes[0].getdescriptorinfo, "")
|
||||||
|
|
||||||
# P2PK output with the specified public key.
|
# P2PK output with the specified public key.
|
||||||
self.test_desc('pk(0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798)', isrange=False, issolvable=True, hasprivatekeys=False)
|
self.test_desc('pk(0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798)', isrange=False, issolvable=True, hasprivatekeys=False)
|
||||||
|
|||||||
Reference in new issue
Block a user