forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
backport: Merge bitcoin#30170, 30026, 30017, 29961, 29904, 29910, 29849 #7257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
vijaydasmp
wants to merge
8
commits into
dashpay:develop
Choose a base branch
from
vijaydasmp:Apr_2026_3
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
2ca3ea7
Merge bitcoin/bitcoin#29849: Fix typos in `subprocess.hpp`
fanquake 5376c8e
Merge bitcoin/bitcoin#29910: refactor: Rename `subprocess.hpp` to fol…
fanquake f40b3b5
Merge bitcoin/bitcoin#29904: refactor: Use our own implementation of …
ryanofsky 4518a34
Merge bitcoin/bitcoin#29961: refactor: remove remaining unused code f…
achow101 05603b5
Merge bitcoin/bitcoin#30017: refactor, fuzz: Make 64-bit shift explicit
fanquake 2da01de
Merge bitcoin/bitcoin#30026: refactor, test: Always initialize pointer
ryanofsky b3098f4
Merge bitcoin/bitcoin#30170: refactor: Use type-safe time in txorphanage
fanquake 9fb5593
Addressing linter errors for using tabs instead of spaces
vijaydasmp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| // Copyright (c) 2024-present The Bitcoin Core developers | ||
| // Distributed under the MIT software license, see the accompanying | ||
| // file COPYING or https://opensource.org/license/mit/. | ||
|
|
||
| #include <common/url.h> | ||
|
|
||
| #include <string> | ||
|
|
||
| #include <boost/test/unit_test.hpp> | ||
|
|
||
| BOOST_AUTO_TEST_SUITE(common_url_tests) | ||
|
|
||
| // These test vectors were ported from test/regress.c in the libevent library | ||
| // which used to be a dependency of the UrlDecode function. | ||
|
|
||
| BOOST_AUTO_TEST_CASE(encode_decode_test) { | ||
| BOOST_CHECK_EQUAL(UrlDecode("Hello"), "Hello"); | ||
| BOOST_CHECK_EQUAL(UrlDecode("99"), "99"); | ||
| BOOST_CHECK_EQUAL(UrlDecode(""), ""); | ||
| BOOST_CHECK_EQUAL(UrlDecode("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789-.~_"), | ||
| "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789-.~_"); | ||
| BOOST_CHECK_EQUAL(UrlDecode("%20"), " "); | ||
| BOOST_CHECK_EQUAL(UrlDecode("%FF%F0%E0"), "\xff\xf0\xe0"); | ||
| BOOST_CHECK_EQUAL(UrlDecode("%01%19"), "\x01\x19"); | ||
| BOOST_CHECK_EQUAL(UrlDecode("http%3A%2F%2Fwww.ietf.org%2Frfc%2Frfc3986.txt"), | ||
| "http://www.ietf.org/rfc/rfc3986.txt"); | ||
| BOOST_CHECK_EQUAL(UrlDecode("1%2B2%3D3"), "1+2=3"); | ||
| } | ||
|
|
||
| BOOST_AUTO_TEST_CASE(decode_malformed_test) { | ||
| BOOST_CHECK_EQUAL(UrlDecode("%%xhello th+ere \xff"), "%%xhello th+ere \xff"); | ||
|
|
||
| BOOST_CHECK_EQUAL(UrlDecode("%"), "%"); | ||
| BOOST_CHECK_EQUAL(UrlDecode("%%"), "%%"); | ||
| BOOST_CHECK_EQUAL(UrlDecode("%%%"), "%%%"); | ||
| BOOST_CHECK_EQUAL(UrlDecode("%%%%"), "%%%%"); | ||
|
|
||
| BOOST_CHECK_EQUAL(UrlDecode("+"), "+"); | ||
| BOOST_CHECK_EQUAL(UrlDecode("++"), "++"); | ||
|
|
||
| BOOST_CHECK_EQUAL(UrlDecode("?"), "?"); | ||
| BOOST_CHECK_EQUAL(UrlDecode("??"), "??"); | ||
|
|
||
| BOOST_CHECK_EQUAL(UrlDecode("%G1"), "%G1"); | ||
| BOOST_CHECK_EQUAL(UrlDecode("%2"), "%2"); | ||
| BOOST_CHECK_EQUAL(UrlDecode("%ZX"), "%ZX"); | ||
|
|
||
| BOOST_CHECK_EQUAL(UrlDecode("valid%20string%G1"), "valid string%G1"); | ||
| BOOST_CHECK_EQUAL(UrlDecode("%20invalid%ZX"), " invalid%ZX"); | ||
| BOOST_CHECK_EQUAL(UrlDecode("%20%G1%ZX"), " %G1%ZX"); | ||
|
|
||
| BOOST_CHECK_EQUAL(UrlDecode("%1 "), "%1 "); | ||
| BOOST_CHECK_EQUAL(UrlDecode("% 9"), "% 9"); | ||
| BOOST_CHECK_EQUAL(UrlDecode(" %Z "), " %Z "); | ||
| BOOST_CHECK_EQUAL(UrlDecode(" % X"), " % X"); | ||
|
|
||
| BOOST_CHECK_EQUAL(UrlDecode("%-1"), "%-1"); | ||
| BOOST_CHECK_EQUAL(UrlDecode("%1-"), "%1-"); | ||
| } | ||
|
|
||
| BOOST_AUTO_TEST_CASE(decode_lowercase_hex_test) { | ||
| BOOST_CHECK_EQUAL(UrlDecode("%f0%a0%b0"), "\xf0\xa0\xb0"); | ||
| } | ||
|
|
||
| BOOST_AUTO_TEST_CASE(decode_internal_nulls_test) { | ||
| std::string result1{"\0\0x\0\0", 5}; | ||
| BOOST_CHECK_EQUAL(UrlDecode("%00%00x%00%00"), result1); | ||
| std::string result2{"abc\0\0", 5}; | ||
| BOOST_CHECK_EQUAL(UrlDecode("abc%00%00"), result2); | ||
| } | ||
|
|
||
| BOOST_AUTO_TEST_SUITE_END() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider to do bitcoin#29967 to addition for bitcoin#29904