Add new validator_info and manifest rpc methods

Returns local validator details and specified manifest information
respectively. Folded and rebased on latest develop
This commit is contained in:
Mo Morsi
2020-01-22 22:13:02 -05:00
committed by Nik Bougalis
parent 2f9edf495e
commit 3578acaf0b
15 changed files with 457 additions and 18 deletions

View File

@@ -309,6 +309,42 @@ ManifestCache::getMasterKey (PublicKey const& pk) const
return pk;
}
boost::optional<std::uint32_t>
ManifestCache::getSequence (PublicKey const& pk) const
{
std::lock_guard lock{read_mutex_};
auto const iter = map_.find (pk);
if (iter != map_.end () && !iter->second.revoked ())
return iter->second.sequence;
return boost::none;
}
boost::optional<std::string>
ManifestCache::getDomain (PublicKey const& pk) const
{
std::lock_guard lock{read_mutex_};
auto const iter = map_.find (pk);
if (iter != map_.end () && !iter->second.revoked ())
return iter->second.domain;
return boost::none;
}
boost::optional<std::string>
ManifestCache::getManifest (PublicKey const& pk) const
{
std::lock_guard lock{read_mutex_};
auto const iter = map_.find (pk);
if (iter != map_.end () && !iter->second.revoked ())
return iter->second.serialized;
return boost::none;
}
bool
ManifestCache::revoked (PublicKey const& pk) const
{