feat: add user version of feature RPC (#4781)

* uses same formatting as admin RPC
* hides potentially sensitive data
This commit is contained in:
Mayukha Vadari
2024-03-05 16:43:31 -05:00
committed by GitHub
parent cce09b717e
commit 22b751834f
7 changed files with 140 additions and 23 deletions

View File

@@ -288,7 +288,7 @@ public:
uint256 const unsupportedID = amendmentId(unsupported_[0]);
{
Json::Value const unsupp =
table->getJson(unsupportedID)[to_string(unsupportedID)];
table->getJson(unsupportedID, true)[to_string(unsupportedID)];
BEAST_EXPECT(unsupp.size() == 0);
}
@@ -296,7 +296,7 @@ public:
table->veto(unsupportedID);
{
Json::Value const unsupp =
table->getJson(unsupportedID)[to_string(unsupportedID)];
table->getJson(unsupportedID, true)[to_string(unsupportedID)];
BEAST_EXPECT(unsupp[jss::vetoed].asBool());
}
}
@@ -638,6 +638,22 @@ public:
BEAST_EXPECT(enabled.empty());
BEAST_EXPECT(majority.empty());
uint256 const unsupportedID = amendmentId(unsupported_[0]);
{
Json::Value const unsupp =
table->getJson(unsupportedID, false)[to_string(unsupportedID)];
BEAST_EXPECT(unsupp.size() == 0);
}
table->veto(unsupportedID);
{
Json::Value const unsupp =
table->getJson(unsupportedID, false)[to_string(unsupportedID)];
BEAST_EXPECT(!unsupp[jss::vetoed].asBool());
}
votes.emplace_back(testAmendment, validators.size());
votes.emplace_back(testAmendment, validators.size());
doRound(