Skip to content

Commit

Permalink
[FOLD] Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
bachase committed Oct 23, 2017
1 parent 5eb3b55 commit 832cc78
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
9 changes: 6 additions & 3 deletions src/ripple/app/misc/impl/ValidatorList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -487,10 +487,13 @@ ValidatorList::getJson() const
continue;
Json::Value& curr = jPublisherLists.append(Json::objectValue);
curr[jss::pubkey_publisher] = strHex(p.first);
curr[jss::seq] = static_cast<Json::UInt>(p.second.sequence);
curr[jss::available] = p.second.available;
curr[jss::expiration] = to_string(p.second.expiration);
curr[jss::version] = requiredListVersion;
if(p.second.expiration != TimeKeeper::time_point{})
{
curr[jss::seq] = static_cast<Json::UInt>(p.second.sequence);
curr[jss::expiration] = to_string(p.second.expiration);
curr[jss::version] = requiredListVersion;
}
Json::Value& keys = (curr[jss::list] = Json::arrayValue);
for (auto const& key : p.second.list)
{
Expand Down
7 changes: 3 additions & 4 deletions src/test/rpc/ValidatorRPC_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,11 @@ class ValidatorRPC_test : public beast::unit_test::suite
auto jp = jrr[jss::publisher_lists][0u];
BEAST_EXPECT(jp[jss::available] == false);
BEAST_EXPECT(jp[jss::list].size() == 0);
BEAST_EXPECT(jp[jss::seq].asUInt() == 0);
BEAST_EXPECT(!jp.isMember(jss::seq));
BEAST_EXPECT(!jp.isMember(jss::expiration));
BEAST_EXPECT(!jp.isMember(jss::version));
BEAST_EXPECT(
jp[jss::pubkey_publisher] == strHex(publisherPublic));
BEAST_EXPECT(jp[jss::expiration] ==
to_string(TimeKeeper::time_point{}));
BEAST_EXPECT(jp[jss::version] == 1);
}
}
{
Expand Down

0 comments on commit 832cc78

Please sign in to comment.