mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Simplify & modernize code:
- Simplify and consolidate code for parsing hex input. - Replace beast::endian::order with boost::endian::order. - Simplify CountedObject code. - Remove pre-C++17 workarounds in favor of C++17 based solutions. - Improve `base_uint` and simplify its hex-parsing interface by consolidating the `SexHex` and `SetHexExact` methods into one API: `parseHex` which forces callers to verify the result of the operation; as a result some public-facing API endpoints may now return errors when passed values that were previously accepted. - Remove the simple fallback implementations of SHA2 and RIPEMD introduced to reduce our dependency on OpenSSL. The code is slow and rarely, if ever, exercised and we rely on OpenSSL functionality for Boost.ASIO as well.
This commit is contained in:
@@ -203,18 +203,11 @@ public:
|
||||
env.trust(bob["USD"](fund), alice);
|
||||
env.close();
|
||||
|
||||
auto toBinary = [](std::string const& text) {
|
||||
std::string binary;
|
||||
for (size_t i = 0; i < text.size(); ++i)
|
||||
{
|
||||
unsigned int c = charUnHex(text[i]);
|
||||
c = c << 4;
|
||||
++i;
|
||||
c = c | charUnHex(text[i]);
|
||||
binary.push_back(c);
|
||||
}
|
||||
|
||||
return binary;
|
||||
auto toBinary = [this](std::string const& text) {
|
||||
auto blob = strUnHex(text);
|
||||
BEAST_EXPECT(blob);
|
||||
return std::string{
|
||||
reinterpret_cast<char const*>(blob->data()), blob->size()};
|
||||
};
|
||||
|
||||
std::string usdTxBlob = "";
|
||||
|
||||
Reference in New Issue
Block a user