mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Format first-party source according to .clang-format
This commit is contained in:
committed by
manojsdoshi
parent
65dfc5d19e
commit
50760c6935
@@ -17,10 +17,10 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#include <test/jtx.h>
|
||||
#include <ripple/beast/unit_test.h>
|
||||
#include <ripple/core/ConfigSections.h>
|
||||
#include <ripple/protocol/jss.h>
|
||||
#include <test/jtx.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
@@ -30,56 +30,64 @@ namespace test {
|
||||
class ManifestRPC_test : public beast::unit_test::suite
|
||||
{
|
||||
public:
|
||||
void testErrors()
|
||||
void
|
||||
testErrors()
|
||||
{
|
||||
testcase ("Errors");
|
||||
testcase("Errors");
|
||||
|
||||
using namespace jtx;
|
||||
Env env(*this);
|
||||
{
|
||||
// manifest with no public key
|
||||
auto const info = env.rpc ("json", "manifest", "{ }");
|
||||
BEAST_EXPECT(info[jss::result][jss::error_message] ==
|
||||
auto const info = env.rpc("json", "manifest", "{ }");
|
||||
BEAST_EXPECT(
|
||||
info[jss::result][jss::error_message] ==
|
||||
"Missing field 'public_key'.");
|
||||
}
|
||||
{
|
||||
// manifest with manlformed public key
|
||||
auto const info = env.rpc ("json", "manifest", "{ \"public_key\": "
|
||||
auto const info = env.rpc(
|
||||
"json",
|
||||
"manifest",
|
||||
"{ \"public_key\": "
|
||||
"\"abcdef12345\"}");
|
||||
BEAST_EXPECT(info[jss::result][jss::error_message] ==
|
||||
"Invalid parameters.");
|
||||
BEAST_EXPECT(
|
||||
info[jss::result][jss::error_message] == "Invalid parameters.");
|
||||
}
|
||||
}
|
||||
|
||||
void testLookup()
|
||||
void
|
||||
testLookup()
|
||||
{
|
||||
testcase ("Lookup");
|
||||
testcase("Lookup");
|
||||
|
||||
using namespace jtx;
|
||||
std::string const key =
|
||||
"n949f75evCHwgyP4fPVgaHqNHxUVN15PsJEZ3B3HnXPcPjcZAoy7";
|
||||
Env env{
|
||||
*this,
|
||||
envconfig([&key](std::unique_ptr<Config> cfg) {
|
||||
cfg->section(SECTION_VALIDATORS).append(key);
|
||||
return cfg;
|
||||
})
|
||||
};
|
||||
Env env{*this, envconfig([&key](std::unique_ptr<Config> cfg) {
|
||||
cfg->section(SECTION_VALIDATORS).append(key);
|
||||
return cfg;
|
||||
})};
|
||||
{
|
||||
auto const info = env.rpc ("json", "manifest", "{ \"public_key\": "
|
||||
"\"" + key + "\"}");
|
||||
auto const info = env.rpc(
|
||||
"json",
|
||||
"manifest",
|
||||
"{ \"public_key\": "
|
||||
"\"" +
|
||||
key + "\"}");
|
||||
BEAST_EXPECT(info[jss::result][jss::requested] == key);
|
||||
BEAST_EXPECT(info[jss::result][jss::status] == "success");
|
||||
}
|
||||
}
|
||||
|
||||
void run() override
|
||||
void
|
||||
run() override
|
||||
{
|
||||
testErrors();
|
||||
testLookup();
|
||||
}
|
||||
};
|
||||
|
||||
BEAST_DEFINE_TESTSUITE(ManifestRPC,rpc,ripple);
|
||||
}
|
||||
}
|
||||
BEAST_DEFINE_TESTSUITE(ManifestRPC, rpc, ripple);
|
||||
} // namespace test
|
||||
} // namespace ripple
|
||||
|
||||
Reference in New Issue
Block a user