aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2022-01-01 02:43:24 +1300
committerMarcoFalke <falke.marco@gmail.com>2022-01-01 02:43:27 +1300
commita1e04e10799791a728cce4430808517598c8742c (patch)
tree35172a442e97a4d89e7066fbe9b6f01bbd927137
parent623745ca74cf3f54b474dac106f5802b7929503f (diff)
parentfa4c599145843b0d3cf998d661281a39bc438d95 (diff)
Merge bitcoin/bitcoin#23926: rpc: Quote user supplied descriptor in error msg
fa4c599145843b0d3cf998d661281a39bc438d95 rpc: Quote user supplied descriptor in error msg (MarcoFalke) Pull request description: Follow-up to commit fa24a3df8796cbf4eeb35d950a4c848d605e5b22 Forgotten in https://github.com/bitcoin/bitcoin/pull/23755 ACKs for top commit: hebasto: ACK fa4c599145843b0d3cf998d661281a39bc438d95, tested locally. prayank23: tACK https://github.com/bitcoin/bitcoin/pull/23926/commits/fa4c599145843b0d3cf998d661281a39bc438d95 Tree-SHA512: bff07bfe95644c94eeb1d27579bf9ffe33df5e709bf6e08cd24f9235f9348dc271ccc868724bcda63b94179bde55625b102cf0b783fad805d0055219743e8e5e
-rw-r--r--src/script/descriptor.cpp4
-rwxr-xr-xtest/functional/rpc_getdescriptorinfo.py4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/script/descriptor.cpp b/src/script/descriptor.cpp
index 0cc38b3003..84040bf847 100644
--- a/src/script/descriptor.cpp
+++ b/src/script/descriptor.cpp
@@ -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
// 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";
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;
}
diff --git a/test/functional/rpc_getdescriptorinfo.py b/test/functional/rpc_getdescriptorinfo.py
index 563f54c5e7..5e6fd66aab 100755
--- a/test/functional/rpc_getdescriptorinfo.py
+++ b/test/functional/rpc_getdescriptorinfo.py
@@ -1,5 +1,5 @@
#!/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
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test getdescriptorinfo RPC.
@@ -30,7 +30,7 @@ class DescriptorTest(BitcoinTestFramework):
def run_test(self):
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(-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.
self.test_desc('pk(0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798)', isrange=False, issolvable=True, hasprivatekeys=False)