Skip to content

Commit

Permalink
changed env unit test based on ED's commit
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterChen13579 committed Jun 22, 2023
1 parent e493534 commit 690ce23
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
11 changes: 11 additions & 0 deletions src/test/rpc/AccountInfo_test.cpp
Expand Up @@ -220,6 +220,10 @@ class AccountInfo_test : public beast::unit_test::suite
"\"api_version\": 2, \"account\": \"" + alice.human() + "\", " +
"\"signer_lists\": true }";

auto const withSignersAsString = std::string("{ ") +
"\"api_version\": 2, \"account\": \"" + alice.human() + "\", " +
"\"signer_lists\": asdfgh }";

// Alice has no SignerList yet.
{
// account_info without the "signer_lists" argument.
Expand All @@ -237,6 +241,13 @@ class AccountInfo_test : public beast::unit_test::suite
BEAST_EXPECT(signerLists.isArray());
BEAST_EXPECT(signerLists.size() == 0);
}
{
// expects error if string used for signer_lists
auto const info =
env.rpc("json", "account_info", withSignersAsString);
BEAST_EXPECT(info[jss::status] == "error");
BEAST_EXPECT(info[jss::error] == "invalidParams");
}

// Give alice a SignerList.
Account const bogie{"bogie"};
Expand Down
8 changes: 1 addition & 7 deletions src/test/rpc/GatewayBalances_test.cpp
Expand Up @@ -153,13 +153,7 @@ class GatewayBalances_test : public beast::unit_test::suite
{
using namespace std::chrono_literals;
using namespace jtx;
Env env{
*this,
envconfig([](std::unique_ptr<Config> c) {
c->loadFromString("\n[beta_rpc_api]\n1\n");
return c;
}),
features};
Env env{*this, features};
env.close();

// Gateway account and assets
Expand Down

0 comments on commit 690ce23

Please sign in to comment.