From 690ce23c00923bf5f9f6005a349d15d803ee9e12 Mon Sep 17 00:00:00 2001 From: Peter Chen Date: Thu, 22 Jun 2023 15:28:51 -0400 Subject: [PATCH] changed env unit test based on ED's commit --- src/test/rpc/AccountInfo_test.cpp | 11 +++++++++++ src/test/rpc/GatewayBalances_test.cpp | 8 +------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/test/rpc/AccountInfo_test.cpp b/src/test/rpc/AccountInfo_test.cpp index 6ec4740bac2..33fa330e4c8 100644 --- a/src/test/rpc/AccountInfo_test.cpp +++ b/src/test/rpc/AccountInfo_test.cpp @@ -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. @@ -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"}; diff --git a/src/test/rpc/GatewayBalances_test.cpp b/src/test/rpc/GatewayBalances_test.cpp index 559c286472c..64b4677c725 100644 --- a/src/test/rpc/GatewayBalances_test.cpp +++ b/src/test/rpc/GatewayBalances_test.cpp @@ -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 c) { - c->loadFromString("\n[beta_rpc_api]\n1\n"); - return c; - }), - features}; + Env env{*this, features}; env.close(); // Gateway account and assets