Convert code to use boost::beast

This commit is contained in:
seelabs
2018-01-22 14:14:02 -05:00
parent eaff9a0e6a
commit cc9c976b76
72 changed files with 471 additions and 1104 deletions

View File

@@ -27,7 +27,7 @@
#include <ripple/protocol/SecretKey.h>
#include <ripple/protocol/Sign.h>
#include <ripple/protocol/STExchange.h>
#include <beast/core/detail/base64.hpp>
#include <boost/beast/core/detail/base64.hpp>
#include <boost/filesystem.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/utility/in_place_factory.hpp>
@@ -123,7 +123,7 @@ public:
Serializer s;
st.add(s);
return beast::detail::base64_encode (std::string(
return boost::beast::detail::base64_encode (std::string(
static_cast<char const*> (s.data()), s.size()));
}
@@ -176,7 +176,7 @@ public:
Serializer s;
st.add(s);
return beast::detail::base64_encode (std::string(
return boost::beast::detail::base64_encode (std::string(
static_cast<char const*> (s.data()), s.size()));
}

View File

@@ -1092,8 +1092,6 @@ public:
auto alice = Account("alice");
auto queued = ter(terQUEUED);
BEAST_EXPECT(env.current()->fees().base == 10);
checkMetrics(env, 0, boost::none, 0, 1, 256);
@@ -1133,7 +1131,6 @@ public:
{"maximum_txn_in_ledger", "5"} }));
auto alice = Account("alice");
auto queued = ter(terQUEUED);
checkMetrics(env, 0, boost::none, 0, 2, 256);

View File

@@ -17,7 +17,7 @@
*/
//==============================================================================
#include <beast/core/detail/base64.hpp>
#include <boost/beast/core/detail/base64.hpp>
#include <ripple/basics/Slice.h>
#include <ripple/basics/strHex.h>
#include <ripple/app/misc/ValidatorList.h>
@@ -89,7 +89,7 @@ private:
derivePublicKey(KeyType::ed25519, secret);
auto const signingKeys = randomKeyPair(KeyType::secp256k1);
return { masterPublic, signingKeys.first,
beast::detail::base64_encode(makeManifestString (
boost::beast::detail::base64_encode(makeManifestString (
masterPublic, secret, signingKeys.first, signingKeys.second, 1)) };
}
@@ -112,7 +112,7 @@ private:
data.pop_back();
data += "]}";
return beast::detail::base64_encode(data);
return boost::beast::detail::base64_encode(data);
}
std::string
@@ -120,7 +120,7 @@ private:
std::string const& blob,
std::pair<PublicKey, SecretKey> const& keys)
{
auto const data = beast::detail::base64_decode (blob);
auto const data = boost::beast::detail::base64_decode (blob);
return strHex(sign(
keys.first, keys.second, makeSlice(data)));
}
@@ -364,7 +364,7 @@ private:
auto const publisherPublic =
derivePublicKey(KeyType::ed25519, publisherSecret);
auto const pubSigningKeys1 = randomKeyPair(KeyType::secp256k1);
auto const manifest1 = beast::detail::base64_encode(makeManifestString (
auto const manifest1 = boost::beast::detail::base64_encode(makeManifestString (
publisherPublic, publisherSecret,
pubSigningKeys1.first, pubSigningKeys1.second, 1));
@@ -415,7 +415,7 @@ private:
}
// do not use list from untrusted publisher
auto const untrustedManifest = beast::detail::base64_encode(
auto const untrustedManifest = boost::beast::detail::base64_encode(
makeManifestString (
randomMasterKey(), publisherSecret,
pubSigningKeys1.first, pubSigningKeys1.second, 1));
@@ -462,7 +462,7 @@ private:
// apply list with new publisher key updated by manifest
auto const pubSigningKeys2 = randomKeyPair(KeyType::secp256k1);
auto manifest2 = beast::detail::base64_encode(makeManifestString (
auto manifest2 = boost::beast::detail::base64_encode(makeManifestString (
publisherPublic, publisherSecret,
pubSigningKeys2.first, pubSigningKeys2.second, 2));
@@ -486,7 +486,7 @@ private:
// do not apply list with revoked publisher key
// applied list is removed due to revoked publisher key
auto const signingKeysMax = randomKeyPair(KeyType::secp256k1);
auto maxManifest = beast::detail::base64_encode(makeManifestString (
auto maxManifest = boost::beast::detail::base64_encode(makeManifestString (
publisherPublic, publisherSecret,
pubSigningKeys2.first, pubSigningKeys2.second,
std::numeric_limits<std::uint32_t>::max ()));
@@ -746,7 +746,7 @@ private:
std::vector<std::string> emptyCfgKeys;
auto const publisherKeys = randomKeyPair(KeyType::secp256k1);
auto const pubSigningKeys = randomKeyPair(KeyType::secp256k1);
auto const manifest = beast::detail::base64_encode (
auto const manifest = boost::beast::detail::base64_encode (
makeManifestString (
publisherKeys.first, publisherKeys.second,
pubSigningKeys.first, pubSigningKeys.second, 1));
@@ -895,7 +895,7 @@ private:
auto const publisherPublic =
derivePublicKey(KeyType::ed25519, publisherSecret);
auto const pubSigningKeys = randomKeyPair(KeyType::secp256k1);
auto const manifest = beast::detail::base64_encode(makeManifestString (
auto const manifest = boost::beast::detail::base64_encode(makeManifestString (
publisherPublic, publisherSecret,
pubSigningKeys.first, pubSigningKeys.second, 1));
@@ -998,7 +998,7 @@ private:
auto const publisherPublic =
derivePublicKey(KeyType::ed25519, publisherSecret);
auto const pubSigningKeys = randomKeyPair(KeyType::secp256k1);
auto const manifest = beast::detail::base64_encode(makeManifestString (
auto const manifest = boost::beast::detail::base64_encode(makeManifestString (
publisherPublic, publisherSecret,
pubSigningKeys.first, pubSigningKeys.second, 1));

View File

@@ -17,7 +17,6 @@
*/
//==============================================================================
#include <beast/core/detail/base64.hpp>
#include <ripple/app/misc/ValidatorSite.h>
#include <ripple/basics/Slice.h>
#include <ripple/basics/strHex.h>
@@ -29,6 +28,7 @@
#include <test/jtx.h>
#include <test/jtx/TrustedPublisherServer.h>
#include <boost/asio.hpp>
#include <boost/beast/core/detail/base64.hpp>
namespace ripple {
namespace test {
@@ -67,7 +67,7 @@ private:
Serializer s;
st.add(s);
return beast::detail::base64_encode (std::string(
return boost::beast::detail::base64_encode (std::string(
static_cast<char const*> (s.data()), s.size()));
}