Merge bitcoin/bitcoin#32520: Remove legacy Parse(U)Int*
faf55fc80bdoc: Remove ParseInt mentions in documentation (MarcoFalke)3333282933refactor: Remove unused Parse(U)Int* (MarcoFalke)fa84e6c36cbitcoin-tx: Reject + sign in MutateTxDel* (MarcoFalke)face2519fabitcoin-tx: Reject + sign in vout parsing (MarcoFalke)fa8acaf0b9bitcoin-tx: Reject + sign in replaceable parsing (MarcoFalke)faff25a558bitcoin-tx: Reject + sign in locktime (MarcoFalke)dddd9e5fe3bitcoin-tx: Reject + sign in nversion parsing (MarcoFalke)fab06ac037rest: Use SAFE_CHARS_URI in SanitizeString error msg (MarcoFalke)8888bb499drest: Reject + sign in /blockhashbyheight/ (MarcoFalke)fafd43c691test: Reject + sign when parsing regtest deployment params (MarcoFalke)fa123afa0eReject + sign when checking -ipcfd (MarcoFalke)fa479857edReject + sign in SplitHostPort (MarcoFalke)fab4c2967dnet: Reject + sign when parsing subnet mask (MarcoFalke)fa89652e68init: Reject + sign in -*port parsing (MarcoFalke)fa9c45577dcli: Reject + sign in -netinfo level parsing (MarcoFalke)fa98041325refactor: Use ToIntegral in CreateFromDump (MarcoFalke)fa23ed7fc2refactor: Use ToIntegral in ParseHDKeypath (MarcoFalke) Pull request description: The legacy int parsing is problematic, because it accepts the `+` sign for unsigned integers. In all cases this is either: * Useless, because the `+` sign was already rejected. * Erroneous and inconsistent, when third party parsers reject it. (C.f. https://github.com/bitcoin/bitcoin/pull/32365) * Confusing, because the `+` sign is neither documented, nor can it be assumed to be present. Fix all issues by removing the legacy int parsing. ACKs for top commit: stickies-v: re-ACKfaf55fc80bbrunoerg: code review ACKfaf55fc80bTree-SHA512: a311ab6a58fe02a37741c1800feb3dcfad92377b4bfb61b433b2393f52ba89ef45d00940972b2767b213a3dd7b59e5e35d5b659c586eacdfe4e565a77b12b19f
This commit is contained in:
18 files changed
+132
-395
No files matched your search
@@ -271,6 +271,8 @@ class RESTTest (BitcoinTestFramework):
|
||||
# Check invalid blockhashbyheight requests
|
||||
resp = self.test_rest_request(f"/blockhashbyheight/{INVALID_PARAM}", ret_type=RetType.OBJ, status=400)
|
||||
assert_equal(resp.read().decode('utf-8').rstrip(), f"Invalid height: {INVALID_PARAM}")
|
||||
resp = self.test_rest_request("/blockhashbyheight/+1", ret_type=RetType.OBJ, status=400)
|
||||
assert_equal(resp.read().decode('utf-8').rstrip(), "Invalid height: +1")
|
||||
resp = self.test_rest_request("/blockhashbyheight/1000000", ret_type=RetType.OBJ, status=404)
|
||||
assert_equal(resp.read().decode('utf-8').rstrip(), "Block height out of range")
|
||||
resp = self.test_rest_request("/blockhashbyheight/-1", ret_type=RetType.OBJ, status=400)
|
||||
|
||||
@@ -56,6 +56,12 @@
|
||||
"output_cmp": "blanktxv2.json",
|
||||
"description": "Creates a blank transaction when nothing is piped into bitcoin-tx (output in json)"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-create", "nversion=+1"],
|
||||
"return_code": 1,
|
||||
"error_txt": "error: Invalid TX version requested",
|
||||
"description": "Tests the check for invalid nversion value"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-create", "nversion=1foo"],
|
||||
"return_code": 1,
|
||||
@@ -126,6 +132,12 @@
|
||||
"output_cmp": "tt-locktime317000-out.json",
|
||||
"description": "Adds an nlocktime to a transaction (output in json)"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-create", "locktime=+317"],
|
||||
"return_code": 1,
|
||||
"error_txt": "error: Invalid TX locktime requested",
|
||||
"description": "Tests the check for invalid locktime value"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-create", "locktime=317000foo"],
|
||||
"return_code": 1,
|
||||
@@ -165,6 +177,15 @@
|
||||
"error_txt": "error: Invalid TX input index",
|
||||
"description": "Tests the check for an invalid string input index with replaceable"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args":
|
||||
["-create",
|
||||
"in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0",
|
||||
"replaceable=+0"],
|
||||
"return_code": 1,
|
||||
"error_txt": "error: Invalid TX input index",
|
||||
"description": "Tests the check for an invalid string input index with replaceable"
|
||||
},
|
||||
{
|
||||
"exec": "./bitcoin-tx",
|
||||
"args":
|
||||
@@ -243,6 +264,14 @@
|
||||
"error_txt": "error: invalid TX sequence id 'abcdef00'",
|
||||
"description": "Try to make invalid input replaceable"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args":
|
||||
["-create",
|
||||
"in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:+0"],
|
||||
"return_code": 1,
|
||||
"error_txt": "error: invalid TX input vout",
|
||||
"description": "Tests the check for an invalid vout value when adding an input"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args":
|
||||
["-create",
|
||||
|
||||
Reference in new issue
Block a user