rippled
Loading...
Searching...
No Matches
UnlList.cpp
1#include <xrpld/app/main/Application.h>
2#include <xrpld/app/misc/ValidatorList.h>
3#include <xrpld/rpc/Context.h>
4
5#include <xrpl/protocol/ErrorCodes.h>
6#include <xrpl/protocol/jss.h>
7
8namespace xrpl {
9
12{
14
15 context.app.validators().for_each_listed([&unl = obj[jss::unl]](PublicKey const& publicKey, bool trusted) {
17
18 node[jss::pubkey_validator] = toBase58(TokenType::NodePublic, publicKey);
19 node[jss::trusted] = trusted;
20
21 unl.append(std::move(node));
22 });
23
24 return obj;
25}
26
27} // namespace xrpl
Represents a JSON value.
Definition json_value.h:130
Value & append(Value const &value)
Append value to array at the end.
A public key.
Definition PublicKey.h:42
virtual ValidatorList & validators()=0
void for_each_listed(std::function< void(PublicKey const &, bool)> func) const
Invokes the callback once for every listed validation public key.
@ objectValue
object value (collection of name/value pairs).
Definition json_value.h:26
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
std::string toBase58(AccountID const &v)
Convert AccountID to base58 checked string.
Definition AccountID.cpp:92
Json::Value doUnlList(RPC::JsonContext &)
Definition UnlList.cpp:11
Application & app
Definition Context.h:21