mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
Merge #19706: refactor: make EncodeBase58{Check} consume Spans
356988e200util: make EncodeBase58Check consume Spans (Sebastian Falbesoner)f0fce0675dutil: make EncodeBase58 consume Spans (Sebastian Falbesoner) Pull request description: This PR improves the interfaces for the functions `EncodeBase58{Check}` by using Spans, in a similar fashion to e.g. PRs #19660, #19687. Note that on the master branch there are currently two versions of `EncodeBase58`: one that takes two pointers (marking begin and end) and another one that takes a `std::vector<unsigned char>` const-ref. The PR branch only leaves one generic Span-interface, both simplifying the interface and allowing more generic containers to be passed. The same is done for `EncodeBase58Check`, where only one interface existed but it's more generic now (e.g. a std::array can be directly passed, as done in the benchmarks). ACKs for top commit: laanwj: Code review ACK356988e200Tree-SHA512: 47cfccdd7f3a2d4694bb8785e6e5fd756daee04ce1652ee59a7822e7e833b4a441ae9362b9bd67ea020d2b5b7d927629c9addb6abaa9881d8564fd3b1257f512
This commit is contained in:
@@ -33,7 +33,7 @@ BOOST_AUTO_TEST_CASE(base58_EncodeBase58)
|
||||
std::vector<unsigned char> sourcedata = ParseHex(test[0].get_str());
|
||||
std::string base58string = test[1].get_str();
|
||||
BOOST_CHECK_MESSAGE(
|
||||
EncodeBase58(sourcedata.data(), sourcedata.data() + sourcedata.size()) == base58string,
|
||||
EncodeBase58(sourcedata) == base58string,
|
||||
strTest);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user