forked from dashpay/dash
-
Notifications
You must be signed in to change notification settings - Fork 714
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge #2414: Finish address encoding cleanup
a470c34 Backport attributes.h and connect it to base58.h functions only (practicalswift) 0247f6f util: Don't allow base58-decoding of std::string:s containing non-base58 characters (practicalswift) 70c480c tests: Add tests for base58-decoding of std::string:s containing non-base58 characters (practicalswift) 9d481be Add bounds checks in key_io before DecodeBase58Check (Pieter Wuille) eac71b5 Finish Encode/Decode destination functions move from base58 to key_io. (furszy) 2e9376c Pass a maximum output length to DecodeBase58 and DecodeBase58Check (Pieter Wuille) c93e19f Clean duplicate usage of DecodeSecret & EncodeSecret. (furszy) 4d4160e Stop using CBase58Data for ext keys (furszy) e861cda Backport string ToUpper and ToLower. (furszy) f6c2872 util: Add Join helper to join a list of strings (MarcoFalke) 32c1e42 Add tests for util/vector.h's Cat and Vector (Pieter Wuille) dc42563 Add some general std::vector utility functions (Pieter Wuille) Pull request description: Decoupled from #2411 Tor's v3 addr support, built on top of #2359. This PR finishes the address encoding cleanup, removing the `CBase58`, `CBitcoinSecret`, `CBitcoinExtKey`, and `CBitcoinExtPubKey` classes, in favor of using the KeyIO::Encode/Decode functions. Furthermore, all PIVX-specific address logic is moved to key_io.{h,cpp}, leaving base58.{h,cpp} as a pure utility that implements the base58 encoding/decoding logic. Plus, includes some general utility functions for std::vector and std::string. Adaptation of the following PRs: * bitcoin#11372. * bitcoin#16670. (without faebf62) * bitcoin#16889. * bitcoin#17511. * bitcoin#17721. ACKs for top commit: random-zebra: rebase utACK a470c34 Fuzzbawls: ACK a470c34 Tree-SHA512: 7a3e1ea0f86c7dab960a5761a666dc7eb291d749e1e9cc24583eec2d6114ca47bc6b9ad50c1c7ff2ecba7f3f60100ce7c0ee8522dc3a2f29d6d79cb052187e0d
- Loading branch information
Showing
54 changed files
with
548 additions
and
409 deletions.
There are no files selected for viewing
This file contains 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 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,22 @@ | ||
// Copyright (c) 2009-2010 Satoshi Nakamoto | ||
// Copyright (c) 2009-2018 The Bitcoin Core developers | ||
// Distributed under the MIT software license, see the accompanying | ||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
|
||
#ifndef BITCOIN_ATTRIBUTES_H | ||
#define BITCOIN_ATTRIBUTES_H | ||
|
||
#if defined(__has_cpp_attribute) | ||
# if __has_cpp_attribute(nodiscard) | ||
# define NODISCARD [[nodiscard]] | ||
# endif | ||
#endif | ||
#ifndef NODISCARD | ||
# if defined(_MSC_VER) && _MSC_VER >= 1700 | ||
# define NODISCARD _Check_return_ | ||
# else | ||
# define NODISCARD __attribute__((warn_unused_result)) | ||
# endif | ||
#endif | ||
|
||
#endif // BITCOIN_ATTRIBUTES_H |
This file contains 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.